Next: , Previous: , Up: expander   [Index]


15.6 Retrieving syntactic binding labels

Every core primitive has a name that is considered part of Vicare’s core language; such primitive name is the actual public name of the binding exported by the boot image. The name of the function display is the symbol display; the name of the record–type descriptor &condition-rtd is the symbol &condition-rtd.

Every core primitive syntactic binding has a unique label gensym associated to it; the label is used to map core primitive’s syntactic identifiers to syntactic binding’s decriptors in the lexical environment.

The property list of the name contains a special entry whose value is the label gensym of the core primitive syntactic binding; we can easily inspect such situation as follows:

(import (vicare)
  (prefix (vicare expander) xp::))

(getprop 'display (xp::system-label-gensym))
⇒ lab.display

;; extract the lexical environment entry describing DISPLAY
(symbol-value (getprop 'display (xp::system-label-gensym)))
⇒ (core-prim . display)

(xp::system-label 'display)
⇒ lab.display

We see that the property list contains an entry with key set to the symbol returned by system-label-gensym; notice that this key is different every time we rebuild the boot image.

Function: system-label symbol

Attempt to extract from symbol the core primitive syntactic binding label of which symbol is the name; if successful return the label, else return #f.

Function: system-label-gensym

Return a special gensym used internally to map core primitive names to their syntactic binding label gensym.