Core Forms

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

See it run

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

Observed result

OUTPUT
42

How to reason about it

  • 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

A common mistake

Surface convenience forms belong to the derived-form reference.

Keep going

Use this page while writing code. For a guided explanation, return to the syntax map or the corresponding manual.

Syntax at a Glance · Learning Path