essential idea: recursive evaluation
even in this trivial example we have
- the fundamental structure of a LISP interpreter
- recursive evaluation
recall our rule for evaluation
- to evaluate a combination expression
evaluate the subexpressions, and
apply the value of the operator subexpressionsto the values of the operand subexpressions
- a primitive expression – a number – evaluates to itself
and in the better version of arith-apply
- namely
(define (arith-apply op x y)(apply (lookup op op-table) (list x y)))
- we have the notion of an environment
- (but a crude one: it’s fixed!)