Lecture 14 Summary, CSE 341, Spring 2004 * Forward references and danger of mutating top-level bindings * Can mutate bindings with set! or (at top-level) define * Don't do it! * But it's nice to see how you can program defensively against it * A common idiom in imperative programming: make a local copy * No need to actually do this on your homework (nobody does) * Lazy evaluation * A more careful consideration of when code is evaluated * Example: why if is not a function * Key idiom: Thunks * Key idiom: Memoization * Key idiom: Streams * Notes: * Thunking and memoizing is equivalent only without effects * Some languages make lazy evaluation of function arguments the default!