7 lines
372 B
Text
7 lines
372 B
Text
(defun eval-subtract-for-two-values-of-x (code-fragment x1 x0)
|
|
(let ((e1 (make-env (list (cons 'x x1)))) ;; create two environments stuffed with binding for x
|
|
(e0 (make-env (list (cons 'x x0)))))
|
|
(- (eval code-fragment e1) ;; pass these environment to eval
|
|
(eval code-fragment e0))))
|
|
|
|
(eval-subtract-for-two-values-of-x '(exp x) 1 2)
|