Quick notes on runtime stack frames C-style approach ================ -------------- SP/FP Parameters Local variables Return value Saved registers -------------- Lisp style ========== -------------- SP/FP Function ref -----> Function representation as a list in the heap, Saved registers - function form (lambda, lambda-block, lambda-closure, lambda-block-closure) -------------- - [ three environment lists ] 0 or 3 - [ function name ] 0 or 1 - parameter list - [ statement ] 0 or more Dynamic scope handling ---------------------- either (a) by searching the function's front environment list for an in-scope variable with the correct name or (b) by maintaining a global hash-table keyed on variable names, where the values are stacks of the current values of those variables (push on declaration, pop on leaving declaration scope)