let

(let ((NAME EXPRESSION) ...) EXPRESSION)
The let expression is similar to the letrec expression, except that the scope of the bindings is different. Like letrec, the body expression may refer to the bindings created by the let. However, the binding expressions (those on the right-hand sides) may not refer to these bindings. To illustrate this, consider the following expressions (and its result):
(define a 3)
(let ((a 16)
      (b a))
  (+ b a))
19
In other words, b's reference to a is bound to the top-level a, rather than the inner one.

Intermediate Student Table of Contents