4.3 Exercise 4.3
We can write the new version of eval like this:
(define (eval- exp env) (if (self-evaluating? exp) (real-exp exp) ((get 'eval (exp-type exp)) (real-exp exp) env))) (define exp-type car) (define real-exp cdr)
We would then install the various operations into the table, e.g.:
(put 'eval 'variable (lambda (exp env) (lookup-variable-value exp env))) (put 'eval 'quoted (lambda (exp env) (text-of-quotation exp))) ...