Normative Rules: Tail-Call Optimization (None Required)

← Prev | ↑ Chapter | Next → | Index | Symbols

Normative Rules: Tail-Call Optimization (None Required)

Statement

AutoLISP does not guarantee tail-call optimization. Recursion is stack-bound on every observed host. Programs that rely on bounded space for tail-recursive loops must be rewritten to use the iterative special forms while, repeat, or foreach.

Vendor Evidence

BricsCAD V26 / macOS direct probe section B: a deliberately-written tail-recursive (count-down n) succeeds at n=1000, then fails at n=10000, 100000, 1000000 with LISP - system call stack limit exceeded. The boundary is well below typical Scheme implementations and is consistent with ordinary stack-frame consumption per call.

Cross-references

  • Compare R7RS 5.11.4 — Scheme requires proper tail recursion (constant space).
  • Compare CLHS 3.5.1.1 — Common Lisp does not require it; behaviour matches AutoLISP.
  • Special Form Entry: WHILE, REPEAT, FOREACH (this chapter) — bounded-space iteration alternatives.

Source Notes

Phase-6 BricsCAD V26 / macOS semantics probe section B.