Next: , Previous: Conservative GC, Up: How Guile does it

A.2.3 Immediates vs Non-immediates

Guile classifies Scheme objects into two kinds: those that fit entirely within an SCM, and those that require heap storage.

The former class are called immediates. The class of immediates includes small integers, characters, boolean values, the empty list, the mysterious end-of-file object, and some others.

The remaining types are called, not surprisingly, non-immediates. They include pairs, procedures, strings, vectors, and all other data types in Guile.

— Macro: int SCM_IMP (SCM x)

Return non-zero iff x is an immediate object.

— Macro: int SCM_NIMP (SCM x)

Return non-zero iff x is a non-immediate object. This is the exact complement of SCM_IMP, above.

Note that for versions of Guile prior to 1.4 it was necessary to use the SCM_NIMP macro before calling a finer-grained predicate to determine x's type, such as SCM_CONSP or SCM_VECTORP. This is no longer required: the definitions of all Guile type predicates now include a call to SCM_NIMP where necessary.