PREV UP NEXT SCM

6.1.6: Smob Cells

A smob is a miscellaneous datatype. The type code and GCMARK bit occupy the lower order 16 bits of the CAR half of the cell. The rest of the CAR can be used for sub-type or other information. The CDR contains data of size long and is often a pointer to allocated memory.

Like ptobs, new varieties of smobs can be defined dynamically (see Defining Smobs). These are the initial smobs:

smob: tc_free_cell
unused cell on the freelist.
smob: tc16_flo
single-precision float.

Inexact number data types are subtypes of type tc16_flo. If the sub-type is:

  1. a single precision float is contained in the CDR.
  2. CDR is a pointer to a malloced double.
smob: tc_dblr
double-precision float.
smob: tc_dblc
double-precision complex.
smob: tc16_bigpos
smob: tc16_bigneg
positive and negative bignums, respectively.

Scm has large precision integers called bignums. They are stored in sign-magnitude form with the sign occuring in the type code of the SMOBs bigpos and bigneg. The magnitude is stored as a malloced array of type BIGDIG which must be an unsigned integral type with size smaller than long. BIGRAD is the radix associated with BIGDIG.

smob: tc16_promise
made by DELAY. See Control features.
smob: tc16_arbiter
synchronization object. See Process Synchronization.
smob: tc16_macro
macro expanding function. See Low Level Syntactic Hooks.
smob: tc16_array
multi-dimensional array. See Arrays.

This type implements both conventional arrays (those with arbitrary data as elements see Conventional Arrays) and uniform arrays (those with elements of a uniform type see Uniform Array).

Conventional Arrays have a pointer to a vector for their CDR. Uniform Arrays have a pointer to a Uniform Vector type (string, bvect, ivect, uvect, fvect, dvect, or cvect) in their CDR.