For a non-immediate Scheme object x, the object type can be
determined by using the SCM_CELL_TYPE
macro described in the
previous section. For each different type of heap object it is known
which fields hold tagged Scheme objects and which fields hold untagged
raw data. To access the different fields appropriately, the following
macros are provided.
scm_t_bits
SCM_CELL_WORD (SCM x, unsigned int n)
¶scm_t_bits
SCM_CELL_WORD_0 (x)
¶scm_t_bits
SCM_CELL_WORD_1 (x)
¶scm_t_bits
SCM_CELL_WORD_2 (x)
¶scm_t_bits
SCM_CELL_WORD_3 (x)
¶Deliver the field n of the heap object referenced by the
non-immediate Scheme object x as raw untagged data. Only use this
macro for fields containing untagged data; don’t use it for fields
containing tagged SCM
objects.
SCM
SCM_CELL_OBJECT (SCM x, unsigned int n)
¶SCM
SCM_CELL_OBJECT_0 (SCM x)
¶SCM
SCM_CELL_OBJECT_1 (SCM x)
¶SCM
SCM_CELL_OBJECT_2 (SCM x)
¶SCM
SCM_CELL_OBJECT_3 (SCM x)
¶Deliver the field n of the heap object referenced by the
non-immediate Scheme object x as a Scheme object. Only use this
macro for fields containing tagged SCM
objects; don’t use it for
fields containing untagged data.
void
SCM_SET_CELL_WORD (SCM x, unsigned int n, scm_t_bits w)
¶void
SCM_SET_CELL_WORD_0 (x, w)
¶void
SCM_SET_CELL_WORD_1 (x, w)
¶void
SCM_SET_CELL_WORD_2 (x, w)
¶void
SCM_SET_CELL_WORD_3 (x, w)
¶Write the raw value w into field number n of the heap object
referenced by the non-immediate Scheme value x. Values that are
written into heap objects as raw values should only be read later using
the SCM_CELL_WORD
macros.
void
SCM_SET_CELL_OBJECT (SCM x, unsigned int n, SCM o)
¶void
SCM_SET_CELL_OBJECT_0 (SCM x, SCM o)
¶void
SCM_SET_CELL_OBJECT_1 (SCM x, SCM o)
¶void
SCM_SET_CELL_OBJECT_2 (SCM x, SCM o)
¶void
SCM_SET_CELL_OBJECT_3 (SCM x, SCM o)
¶Write the Scheme object o into field number n of the heap
object referenced by the non-immediate Scheme value x. Values
that are written into heap objects as objects should only be read using
the SCM_CELL_OBJECT
macros.
Summary:
SCM_CELL_TYPE (x)
.