--- /dev/null
+#lang racket
+
+(require "metacircular2-lazy.rkt")
+
+(define env1 (make-environment))
+(eval '(define count 0) env1)
+(eval '(define (id x) (set! count (+ count 1)) x) env1)
+
+#|
+
+> (eval '(define w (id (id 0))) env1)
+> (eval 'count env1)
+1
+> (eval 'w env1)
+#0='(thunk
+ (id 0)
+ #1=(#hash((< . (primitive #<procedure:<>))
+ (* . (primitive #<procedure:*>))
+ (> . (primitive #<procedure:>>))
+ (- . (primitive #<procedure:->))
+ (= . (primitive #<procedure:=>))
+ (true . #t)
+ (+ . (primitive #<procedure:+>))
+ (list . (primitive #<procedure:list>))
+ (null? . (primitive #<procedure:null?>))
+ (/ . (primitive #<procedure:/>))
+ (car . (primitive #<procedure:car>))
+ (false . #f)
+ (cdr . (primitive #<procedure:cdr>))
+ (cons . (primitive #<procedure:cons>))
+ (count . 1)
+ (id . (procedure (x) ((set! count (+ count 1)) x) #1#))
+ (w . #0#))))
+> (eval 'count env1)
+1
+>
+
+|#
\ No newline at end of file
--- /dev/null
+#lang racket
+
+(require "metacircular2-lazy.rkt")
+
+#|
+Forcing is needed for any higher order procedure. An example is map. If you evaluate the following
+code with `actual-value' instead of `eval' of operator, it executes fine but if not, then eval gets
+a thunk object (the two operands) for evaluation and when it reaches `apply' inside the `cons' it
+will fail as `apply' does not know about thunk objects.
+|#
+
+(define env1 (make-environment))
+(eval '(define (map f xs)
+ (if (null? xs)
+ '()
+ (cons (f (car xs)) (map f (cdr xs)))))
+ env1)
+(eval '(map (lambda(x) (* x x)) '(1 2 3)) env1)
\ No newline at end of file
--- /dev/null
+#lang racket
+
+#|
+
+Any program which will call itself or another function recursively or repeatedly (as another argument)
+will benefit from memoization.
+
+non-memoized version will have count of 2 as x gets forced twice in the expression (* x x). In memoized
+version, it will be 1.
+
+|#
\ No newline at end of file