{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

day14 - CS1 Introduction to Computation Day 14 Environment...

Info iconThis preview shows pages 1–17. Sign up to view the full content.

View Full Document Right Arrow Icon
Caltech CS1 -- Fall 2007 CS1: Introduction to Computation Day 14: November 14, 2007 Environment Model and Local State
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Caltech CS1 -- Fall 2007 Today Review environment model – frames – environments – procedures Encapsulation of state Message-passing style
Background image of page 2
Caltech CS1 -- Fall 2007 Bindings A binding is an association between a name and a Scheme value • Names: – variable names, procedure names – formal parameters of procedures – in let statements: ( let ((name value) ...) ...) Values: any Scheme value
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Caltech CS1 -- Fall 2007 Bindings A binding is an association between a name and a Scheme value • Examples: name: x value: 10 name: y value: #f name: square value: (lambda (x) (* x x))
Background image of page 4
Caltech CS1 -- Fall 2007 Frames A frame is a collection of bindings: x: 10 y: #f square: (lambda (x) (* x x))
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon