Gist b0f107f75c74641d68796a796f343bb5
✓ Published0🌍 Public
Aakeshavan
Last edited Nov 7, 2016
Created on Nov 7, 2016
This notebook demonstrates a Scheme interpreter’s evaluation process, showing how expressions like `(+ 1 2)` and `(+ 1 (* 2 3))` are recursively parsed and reduced. The code uses custom `Pair` and `nil` data structures from `scheme_primitives` and `scheme_reader`, with `scheme_eval` printing each subexpression’s representation and tracing symbol lookups, self-evaluation, and procedure application. Output cells display intermediate results, such as `Pair(3, nil)` after adding 1 and 2, alongside debug print statements that reveal the step-by-step evaluation order. The example highlights the interpreter’s handling of nested combinations and its error-checking via `check_procedure`.
AI-generated description