3 (require "metacircular2-lazy.rkt")
6 Forcing is needed for any higher order procedure. An example is map. If you evaluate the following
7 code with `actual-value' instead of `eval' of operator, it executes fine but if not, then eval gets
8 a thunk object (the two operands) for evaluation and when it reaches `apply' inside the `cons' it
9 will fail as `apply' does not know about thunk objects.
12 (define env1 (make-environment))
13 (eval '(define (map f xs)
16 (cons (f (car xs)) (map f (cdr xs)))))
18 (eval '(map (lambda(x) (* x x)) '(1 2 3)) env1)