[previous] [up] [next]     [contents] [index]
Next: Argument Lists Up: Expressions Previous: Expressions

Identifiers and Binding

The Core Scheme unit recognizes that identifiers may be free or (lexically) bound. To accomodate additional binding forms, a distinction is first drawn between free and bound variables:

top-level-varref : varref ()

bound-varref : varref (binding)

One sub-type of the latter is also defined:

lexical-varref : bound-varref ()

The binding field of a bound-varref refers to an object of type binding, with a lexical-varref referring to an object of type lexical-binding:

binding : parsed (var orig-name)

lexical-binding : binding ()

The var field contains a Scheme symbol representing the name of the bound identifier. Since hygienic renaming may have taken place, the orig-name field holds the original name (which may have been provided in the source, or been introduced via a macro or micro).

The binding field may be used to distinguish between bound variables in that exactly all occurrences of the same bound identifier contain the same value in their binding field (in the sense of eq?).

NOTE: There is no justification for binding to be a sub-type of parsed; this dependency will be elided.



PLT