There are no booleans. In this section, we add a let expression to our language to allow local bindings. Environments From the BNF, we expect that we will recurse once on the body of the let expression and also recurse once for each expression in the declarations. The problem is that when we recurse on the body, we must have an environment with new bindings corresponding to the declarations. So far, the only environment we have defined is the initial environment, init-env .
Every expression is evaluated in the initial environment.
Clearly we must be able to evaluate different expressions in different environments for the let expression to have the correct semantics. Now, when we recurse, we not only pass the expression to be evaluated, but the environment in which to evaluate it. Since eval-rand is a curried function, the result is a function that takes an expression and evaluates it in the current environment. Now, we are ready to define the behavior of a let expression. The expressions in the declarations are evaluated in the current environment and the global environment is then extended to include bindings of those values.