This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: ;;;;LAZY EVALUATOR FROM SECTION 4.2 OF ;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS ;;;;Matches code in ch4.scm ;;;; Also includes enlarged primitive-procedures list ;;;;This file can be loaded into Scheme as a whole. ;;;;**NOTE**This file loads the metacircular evaluator of ;;;; sections 4.1.1-4.1.4, since it uses the expression representation, ;;;; environment representation, etc. ;;;; You may need to change the (load ...) expression to work in your ;;;; version of Scheme. ;;;;Then you can initialize and start the evaluator by evaluating ;;;; the expression (mce). ;;**implementation-dependent loading of evaluator file ;;Note: It is loaded first so that the section 4.2 definition ;; of eval overrides the definition from 4.1.1 (load "~cs61a/lib/mceval.scm") ;; To run without memoization, reload the first version of force-it below ;;;SECTION 4.2.2 ;;; Modifying the evaluator (define (mc-eval exp env) (cond ((self-evaluating? exp) exp) ((variable? exp) (lookup-variable-value exp env))((variable?...
View Full Document
This note was uploaded on 11/30/2010 for the course EECS 21281 taught by Professor Harvey during the Spring '10 term at Berkeley.
- Spring '10