COMPSCI 61A Lecture Notes - Lecture 28: Eval, Universal Turing Machine, Tail Call
zogo39484755 and 6 others unlocked
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents
Document Summary
Way in which names are looked up in scheme and python is called lexical scope (or static scope) Lexical scope: parent frame is the environment in which a procedure was defined. Dynamic scope: parent of a frame is the enviornment in which a procedure was called. Define (f (lambda (x) (+ x y))) define g (lambda (x y ), (f (+ x x ))))) Lexical scope: parent for f"s frame is the global frame. Dynamic scope: parent for f"s frame is g"s frame. No re-asignment and no mutable data types name -value bindings are permanent. Val of expr is independ of order in wich sub-expressions are evaluated. Subexpressions can safely be evaluated in parallel or on demand. Referential transparency: val of expression does not change when we substitute one of its subexpressions with the value of the subexpression. Allows for memoization w/ worry of changing behavior over stuff. Functional programming lang can be just as efficient as regular.