4.1 变量引用

syntax: variable returns: the value of variable

在程序中表现为表达式的任何标识符都是变量,如果有该标识符的可见变量绑定存在的话。即,标识符出现在由 define, lambda, let 或其他一些语法结构所创建的绑定的作用域内。

list => #<procedure>
(define x 'a)
(list x x) => (a a)
(let ([x 'b])
  (list x x)) => (b b)
(let ([let 'let]) let) => let

如果在库或者顶级程序中引用了未被绑定为变量,关键字,记录名称或其它实体的标识符,则发生语法违规。Since the scope of the definitions in a library, top-level program, lambda, or other local body is the entire body, it is not necessary for the definition of a variable to appear before its first reference appears, as long as the reference is not actually evaluated until the definition has been completed. So, for example, the reference to g within the definition of f below

results matching ""

    No results matching ""