Skip to main content

Lexical scope and evaluator contracts

This required 20–30-hour package replaces the former 3–4-hour interpreter exercise: lessons and prediction 6–8, implementation and fault analysis 9–14, assessment and delayed repair 5–8. Estimates are author planning assumptions awaiting learner pilots. Existing abstraction, mutation, streams, staging and concurrency practice remains required; this small evaluator does not satisfy all those objectives. See the reconciled semester workload.

Prerequisite bridge​

Before starting, draw a linked list of three dictionaries, write recursive tree traversal, and distinguish a function value from calling it. If any task is difficult, spend 1–2 hours inside the lesson allocation revisiting the module's first-class procedures and environment-model concepts. Connect frame reachability to Module 2 ownership, but do not pretend Python garbage collection has C's lifetime rules.

Sequence​

  1. Frame identity and lexical lookup.
  2. Evaluation order and special forms.
  3. Guest-language boundaries.
  4. Prediction practice, runnable lab, then LI1–LI6 assessment.

Selective resources​

Use the existing SICP book backbone for environment diagrams and evaluator structure. The SICP Comparison Edition environment section is a free targeted companion; select the Scheme presentation when comparing with the original text. Norvig's Lispy essay supplies a compact interpreter comparison: inspect environments and procedure application after attempting this lab, and list three semantic differences. These primary sources were checked on 2026-10-23. Reading is selective; no purchase or book conversion is required. The lessons and code here are original exercises, not redistributed book chapters.