Warning: This is the manual of the legacy Guile 2.0 series. You may want to read the manual of the current stable series instead.
Next: Heap Cell Type Information, Previous: Non-immediate objects, Up: The SCM Type in Guile [Contents][Index]
Guile provides both ordinary cells with two slots, and double cells with four slots. The following two function are the most primitive way to allocate such cells.
If the caller intends to use it as a header for some other type, she
must pass an appropriate magic value in word_0, to mark it as a
member of that type, and pass whatever value as word_1, etc that
the type expects. You should generally not need these functions,
unless you are implementing a new datatype, and thoroughly understand
the code in <libguile/tags.h>
.
If you just want to allocate pairs, use scm_cons
.
Allocate a new cell, initialize the two slots with word_0 and word_1, and return it.
Note that word_0 and word_1 are of type scm_t_bits
.
If you want to pass a SCM
object, you need to use
SCM_UNPACK
.
Like scm_cell
, but allocates a double cell with four
slots.