Topics: * State: assignment to boxes and assignment to variables. * The difference between call-by-value and call-by-name. For example, {{fun {x} 0} {+ 1 {fun {y} y}}} produces an error with call-by value, but 0 with call-by-name. * Writing web servlets using `web-send' and `web-send/k'. * Evaluation with `let/cc'. For example, (let/cc k (+ 1 (k (- 3 4)))) produces -1, not 0. * Interpretation with `interp' and `continue'. See example below. * Two-space garbage collection (see end of 10/31 slides). ---------------------------------------- Showing every call to `interp' and `continue', representing continuations with records, for {+ 1 {{fun {y} y} 3}} interp expr = {+ 1 {{fun {y} y} 3}} sc = (mtSub) cont = (mtK) interp expr = 1 sc = (mtSub) cont = (addSecondK {{fun {y} y} 3} (mtSub) (mtK)) = c1 continue value = 1 cont = c1 interp expr = {{fun {y} y} 3} sc = (mtSub) cont = (doAdd 1 (mtK)) interp expr = {fun {y} y} sc = (mtSub) cont = (appArgK 3 (mtSub) (doAdd 1 (mtK))) = c2 continue value = (closureV 'y y (mtSub)) cont = c2 interp expr = 3 sc = (mtSub) cont = (doAppK (closureV 'y y (mtSub)) (doAdd 1 (mtK))) = c3 continue value = 3 cont = c3 interp expr = y sc = (aSub 'y 3 (mtSub)) cont = (doAdd 1 (mtK)) continue value = 3 cont = (doAdd 1 (mtK)) continue value = 4 cont = (mtK)