3.5 Variable References and #%top
Refers to a module-level or local binding, when id
not bound as a transformer (see Expansion
). At run-time,
the reference evaluates to the value in the location
When the expander encounters an id that is not bound by a
module-level or local binding, it converts the expression to
(#%top . id) giving #%top
the lexical context of the id; typically, that context refers
to #%top. See also Expansion Steps.
Refers to a module-level or top-level definition. If id
local binding in its context, then (#%top . id)
refers to a
top-level definition, but a reference to a top-level definition is
disallowed within a module.
Within a module form, (#%top . id) expands to just
id—with the obligation that id is defined within
the module and has no local binding in its context. At phase
level 0, (#%top . id) is an immediate syntax error if
id is not bound. At phase level 1 and higher, a syntax
error is reported if id is not defined at the corresponding
phase by the end of module-body partial expansion.
See also Expansion Steps for information on how the expander
introduces #%top identifiers.