Skip to main content

Module interpreter

Module interpreter 

Source
Expand description

Tree-walking interpreter — SexpValue.

Minimal but complete enough to evaluate real Lisp programs that produce typed Derivation values. Special forms handled inline (to respect evaluation order / lazy arms); everything else dispatches via apply over evaluated arguments.

Special forms:

  • quote — return the literal Sexp as Value
  • if — short-circuit branches
  • let — non-recursive bindings
  • letrec — recursive bindings via thunks
  • lambda — closure capture
  • define — bind in top-level env
  • begin — sequential evaluation
  • set! — mutate a top-level binding (restricted; see docs)

Structs§

Interpreter