Next: , Up: objects symbols   [Index]


13.12.1 The value and proc slots

The value field has multiple purposes:

About the proc slot: when a top level binding is never assigned (in other words: it is immutable) and its value is a closure object, the associated loc gensym holds its value in both the value slot and the proc slot. Whenever binary code in a code object performs a call to a non–assigned top level closure object, it does the following:

  1. From the relocation vector of the current code object: retrieve the loc gensym of the closure to call.
  2. From the loc gensym: extract the value of the proc slot, which is meant to be a reference to the closure object. This is done by accessing the gensym object with a low–level assembly instruction, not necessarily by using the primitive operation $symbol-proc.
  3. Actually call the closure object.

Values stored in the value slot of loc gensyms can be closure objects or not; they can be called by binary code, but they need to be validated as closure objects first. Values stored in the proc slot can only be references to closure objects and they can be called by binary code without being first validated.

Use in primitive function syntactic bindings

All the primitive functions implemented by code in Vicare’s boot image are accessible from libraries defined by the boot image; such primitive functions have a loc gensym associated to them, in which both the value and proc slots hold a reference to the actual closure object. The bindings of primitive functions are immutable.

Use in library top level syntactic bindings

All the top level bindings defined by a library form have a loc gensym associated to them:


Next: , Up: objects symbols   [Index]