TOOLS AND SCOPE for 10 Created by a lambda expression, this data structure holds formals, code, and an environment. TOOLS AND SCOPE for 20 (lambda (f) (lambda (x) (lambda (y) (f x y)))) TOOLS AND SCOPE for 30 ::= | (lambda () ) | ( ) TOOLS AND SCOPE for 40 For example, x in the expressions x, (lambda (y) x), and (f x) TOOLS AND SCOPE for 50 A region in which inner declations shadow outer declarations. SYNTACTIC AND DATA ABSTRACTION for 10 let x = 342 in +(x,x) ==> (proc(x) +(x,x))(342) SYNTACTIC AND DATA ABSTRACTION for 20 (if test1 test2 #f) SYNTACTIC AND DATA ABSTRACTION for 30 (let ((*key* e)) (cond ((memv *key* 'kl1) b1) ... ((memv *key* 'kln) bn) (else be))) SYNTACTIC AND DATA ABSTRACTION for 40 Produces the procedures leaf?, make-leaf, and leaf->number. SYNTACTIC AND DATA ABSTRACTION for 50 This property is achieved when the way an ADT is implemented can be changed without changing the rest of the program. IMPERATIVES for 10 The begin primitive in Scheme, and the semicolon (;) in C++. IMPERATIVES for 20 Assignment, data structure mutation, and input/output. IMPERATIVES for 30 Two expressions that denote the same cell. IMPERATIVES for 40 (lambda (cell-1 cell-2) (let ((temp (cell-ref cell-1))) (cell-set! cell-1 (cell-ref cell-2)) (cell-set! cell-2 temp)))) IMPERATIVES for 50 The type void. INTERPRETERS for 10 (extend-env prim-op-names (map expressed->denoted (map make-prim-proc prim-op-names)) the-empty-env) INTERPRETERS for 20 (apply-env env var) INTERPRETERS for 30 (eval-exp body (extend-env formals args env)) INTERPRETERS for 40 Denoted-Value = Cell(Expressed-Value) INTERPRETERS for 50 Found in an interpreter in which the semantics of a procedure is the text of the procedure. PARAMETER PASSING for 10 Model where arrays are denoted by variables. PARAMETER PASSING for 20 (lambda (exp-val) (if (array? exp-val) (array->denoted (array-copy (expressed->array exp-val))) (make-cell (expressed->storable exp-val))))) PARAMETER PASSING for 30 (define-record ae (array index)) PARAMETER PASSING for 40 A procedure that doesn't work by reference, but does work by value-result. PARAMETER PASSING for 50 Denoted-Value = Cell(Storable-Value) + Array(Storable-Value) + Array-Element(Storable-Value) Storable-Value = Number + Procedure Array(T) = {Cell(T)}* Tools Syntax Imper- Interp- Param Scope Data Ab ative reters Passing ======================================= 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50