Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
(defun eval-subtract-for-two-values-of-x (code-fragment x1 x0)
|
||||
(- (eval ^(let ((x ,x1)) ,code-fragment))
|
||||
(eval ^(let ((x ,x0)) ,code-fragment))))
|
||||
|
||||
(eval-subtract-for-two-values-of-x 1 2) ;; yields -4.67077427047161
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(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)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
(defun eval-subtract-for-two-values-of-x (code-fragment x1 x0)
|
||||
(let ((e1 (make-env))
|
||||
(e0 (make-env)))
|
||||
(env-vbind e1 'x x1)
|
||||
(env-vbind e0 'x x0)
|
||||
(- (eval code-fragment e1)
|
||||
(eval code-fragment e0))))
|
||||
|
||||
(eval-subtract-for-two-values-of-x '(exp x) 1 2)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(defvar x)
|
||||
|
||||
(defun eval-subtract-for-two-values-of-x (code-fragment x1 x0)
|
||||
(- (let ((x x1)) (eval code-fragment))
|
||||
(let ((x x0)) (eval code-fragment))))
|
||||
|
||||
(eval-subtract-for-two-values-of-x '(exp x) 1 2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue