Cheat sheets

CD-13Cheat sheet1 pageIn a paid pack

Runtime Storage and Activation Records

Run-time memory layout (code, static data, heap, stack), static, stack and heap allocation and what each supports, the fields of an activation record, activation trees and the control stack with script-counted activations for recursive calls, calling and return sequences, and how non-local names are reached under nested procedures with access links or a display. A diagram shows four live frames whose control links and access links differ.

Diagrams from CD-13

CD-14Cheat sheet1 pageIn a paid pack

Scoping and Parameter Passing

Static and dynamic scoping rules with three script-run programs, including nested procedures where the access link and the control link lead to different variables. Parameter passing by value, reference, value-result and name compared, with outputs of the same programs under every mode: aliasing through f(x, x), a global changed inside the callee, and the swap(i, a[i]) failure under call by name. Conventions that change the answer, such as the copy-back order of value-result, are marked.