In this lecture we will further discuss the semantics of scheme expressions. We will begin with a simple model, called the substitution model, where a function application corresponds to substituting the argument expressions into the formal parameters of the function body. The substitution process can proceed in different orders - scheme uses applicative order, where the arguments are fully evaluated prior to substitution. Other possibilities exist - for example, the arguments can be immediately substituted and then only further expanded when needed (normal order). The substitution model of function application is formally investigated using the lambda calculus, which will be discussed later in the course.
When assignment is introduced the substitution model falls apart and a different model, more complicated model, must be used. In lecture 2, we introduced the notion of environments, which are used to lookup and modify variables. Environments can be nested to handle nested scope, and the nesting can be established at the time of function definition (static scoping) or at the time of function application (dynamic scoping). The semantics of scheme using environments can be described operationally using an interpreter