•TheScheme-1interpreter[This topic may be in week 5 or in week 6 depending on the holiday schedule.]We’re going to investigate a Scheme interpreter written in Scheme. SICP has a rather large and detailedScheme interpreter in Chapter 4, which we’ll get to near the end of the semester. But students often findthat program intimidating, so we’re going to work up to it with a series of three smaller versions that leaveout some details and some of the features of real Scheme. This week we’ll use theScheme-1interpreter.We weren’t ready for this investigation until we had the idea of lists that contain sublists, because that’swhat a Scheme program is – a list. That’s the point of all those parentheses; the Scheme language can lookat a Scheme program as data, rather than as something different from data.Here’s how we use the interpreter:STk> (load "~cs61a/lib/scheme1.scm")STk> (scheme-1)Scheme-1: (+ 2 3)5Scheme-1: ((lambda (x) (* x 3)) 4)12To leaveScheme-1
This is the end of the preview.
access the rest of the document.