environments
what does Scheme have that our arithmetic expression language doesn’t?
- procedures
- variables and environments
these are interwoven because
- environments are needed to execute procedures
- basic idea of parameter binding:
evaluate the body
in an environment that has the parameters bound to the argument values
lexical scoping
- recall that in Scheme
a procedure carries with itthe environment in which it was created
and the environment in which its body is evaluated is an extension of this environment
- this is not so essential (but it’s very nice)