Next: expander lexenv prim, Previous: expander lexenv stx, Up: expander lexenv [Index]
A syntactic binding’s descriptor is a pair with the format:
(?binding-type . ?binding-value)
where ?binding-type is a symbol and the format of ?binding-value depends on the binding type.
Every syntactic binding has a unique label gensym associated to it; during the expansion process, no matter the current lexical context, given a label gensym we can retrieve the associated binding descriptor.
Under Vicare, symbol objects are data structures with a slot
named value, accessor symbol-value and mutator
set-symbol-value!. This slot is usually initialised to the
built–in object returned by (unbound-object); we can inspect the
state of the slot with symbol-bound?. The expander makes use of
this slot in label gensyms:
value slot of their label gensym.
value slot
of these gensyms is set to the return value of (unbound-object).
Given a label gensym we can determine if it is associated to an imported
syntactic binding by inspecting its value slot: if
symbol-bound? applied to the label returns #t, the binding
is imported; otherwise it was established by the code being expanded.