Next: Assignments, Previous: Dynamic Binding, Up: Special Forms
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
,fluid-let
, or “proceduredefine
” 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 “proceduredefine
”), the component formals is identical to the component of the same name in anamed-lambda
expression. In fact, these two expressions are equivalent:(define (name1 name2 ...) expression expression ...) (define name1 (named-lambda (name1 name2 ...) expression expression ...))