Definitions (MIT/GNU Scheme 11.2)

Next: Assignments, Previous: Dynamic Binding, Up: Special Forms [Contents][Index]

### 2.4 Definitions

extended standard special form: define variable [expression]
standard special form: define formals expression expression …

  Definitions are valid in some but not all contexts where expressions are allowed. Definitions may only occur at the top level of a program and at the beginning of a lambda body (that is, the body of a `lambda`, `let`, `let*`, `letrec`, `letrec*`, `let-values`, `let*-values`, `parameterize`, or “procedure `define`” expression). A definition that occurs at the top level of a program is called a top-level definition, and a definition that occurs at the beginning of a body is called an internal definition.

  In the second form of `define` (called “procedure `define`”), the component formals is identical to the component of the same name in a `named-lambda` expression. In fact, these two expressions are equivalent:

      (define (name1 name2 …)
        expression
        expression …)

      (define name1
        (named-lambda (name1 name2 …)
          expression
          expression …))