Expressions and Evaluation Order

Evaluation order is observable and fixed: operator first, operands left to right, then arity checking and procedure entry.

At a glance

LISPEX
(define x 0)
(list (begin (set! x 1) x) (begin (set! x (+ x 1)) x))

Result

OUTPUT
(1 2)

Current guarantees

  • let initializers use the enclosing environment left to right; let* extends one binding at a time; letrec allocates all cells first.
  • Sequences evaluate left to right and discard non-final value packets.
  • and and or short-circuit left to right; only #f is false.

Boundaries

  • Lispex does not inherit an unspecified operand order from another Scheme implementation.
  • Arity errors occur after already-required operator and operand evaluation.