Core Forms

The evaluator core consists of quotation, variable reference, if, sequencing, lambda, application, assignment, definition, lexical binding, and fixed control nodes.

At a glance

LISPEX
((lambda (x) (if #t x 0)) 42)

Result

OUTPUT
42

Current guarantees

  • if has a mandatory else arm; begin and procedure bodies preserve left-to-right order.
  • lambda supports fixed and dotted formals; set! mutates an existing cell; define updates or creates a top-level cell.
  • quote returns immutable literal data; runtime does not evaluate quoted elements.

Form contracts

FormArity / evaluationResult or fault
quote1 datum; no element evaluationimmutable datum
iftest, consequent, alternate; test firstselected branch packet; E320 if test is not one value
lambdaformals plus 1..N body formsclosure; E302 when applied with wrong arity
set!name and single-value RHSzero values; E303 if unbound
let / letrecbinding list plus 1..N body formslast body packet; E321 on uninitialized letrec read

Boundaries

  • Surface convenience forms belong to the derived-form reference.