Variable References

Variable References

Syntax: variable
returns: the value of variable

Any unquoted identifier appearing in an expression is a keyword or variable reference. It is a keyword reference if a lexical or top-level keyword binding for the identifier is visible; otherwise, it is a variable reference. It is an error to evaluate a top-level variable reference before the variable is defined at top-level, but it is not an error for a variable reference to appear within an expression that has not yet been evaluated.

list #
(define x 'a)
(list x x) (a a)
(let ((x 'b))
(list x x)) (b b)
(let ((let 'let)) let) let
(define f
(lambda (x)
(g x)))
(define g
(lambda (x)
(+ x x)))
(f 3) 6