Notes40 - The Scheme-1 interpreter[This topic may be in week 5 or in week 6 depending on the holiday schedule Were going to investigate a Scheme

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
The Scheme-1 interpreter [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 detailed Scheme interpreter in Chapter 4, which we’ll get to near the end of the semester. But students often Fnd that program intimidating, so we’re going to work up to it with a series of three smaller versions that leave out some details and some of the features of real Scheme. This week we’ll use the Scheme-1 interpreter. We weren’t ready for this investigation until we had the idea of lists that contain sublists, because that’s what a Scheme program is – a list. That’s the point of all those parentheses; the Scheme language can look at a Scheme program as data, rather than as something di±erent from data. Here’s how we use the interpreter: STk> (load "~cs61a/lib/scheme1.scm") STk> (scheme-1) Scheme-1: (+ 2 3) 5 Scheme-1: ((lambda (x) (* x 3)) 4) 12 To leave Scheme-1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/17/2010 for the course COMPUTER S 26275 taught by Professor Harvey,b during the Spring '10 term at University of California, Berkeley.

Ask a homework question - tutors are online