SAMPLE OUTPUT FROM METACIRCULAR INTERPRETER FOR INSPECT-IT AND DEBUG-INFO (some of the global variables are omitted from the global frame) (inspect-it map) => (compound-procedure (f s) ((if (null? s) '() (cons (f (car s)) (map f (cdr s)))))) function environment: ***** new frame ***** map: (compound-procedure (f s) ((if (null? s) '() (cons (f (car s)) (map f (cdr s))))) ) car: (primitive #) ..... (more globals) ..... ***** display environment done ***** showing debug-info results: (let ((x 3) (y 4) (z 5)) (let ((x 100) (y x)) (debug-info) x)) => debug-info here. Current environment is as follows: ***** new frame ***** x: 100 y: 3 ***** new frame ***** x: 3 y: 4 z: 5 ***** new frame ***** car: (primitive #) ..... (more globals) ..... ***** display environment done ***** 100 inspecting a function with a complex environment: expected result for (catch-octopus 100): 165 (define (octopus n) (let ((x 10) (y 20)) (let ((z 30)) (lambda (w) (+ n w x y z))))) => ok (define catch-octopus (octopus 5)) => ok (inspect-it catch-octopus) => (compound-procedure (w) ((+ n w x y z))) function environment: ***** new frame ***** z: 30 ***** new frame ***** x: 10 y: 20 ***** new frame ***** n: 5 ***** new frame ***** catch-octopus: (compound-procedure (w) ((+ n w x y z)) ) octopus: (compound-procedure (n) ((let ((x 10) (y 20)) (let ((z 30)) (lambda (w) (+ n w x y z))))) ) car: (primitive #) ..... (more globals) ..... ***** display environment done *****