Lexical Scoping
Definition of ADDN works because:
- All free variables in a lambda expression are assigned values at the time that the lambda is defined (i.e., evaluated and returned)
- If a free variable has no value, an error is generated
- Bound variables do not receive values until the lambda is applied (i.e., converted)
This convention is called lexical scoping
- In the opposite convention, called dynamic scoping, free variables have values determined when lambda is applied
- Failure to find a value at run-time generates an error
- Early versions of LISP were dynamically scoped, but Common LISP and Scheme are lexically scoped