Special Form Entry: WHILE

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

Special Form Entry: WHILE

Name

while

Class

Special Form

Syntax

(while testexpr [expr ...])

Description

Repeatedly evaluates body forms while the test remains non-nil.

Evaluation Rules

  • evaluate testexpr
  • if the result is non-nil, evaluate the body forms in order and then repeat
  • stop when testexpr evaluates to nil

Return Values

Returns the value of the last body expression of the last iteration, or nil if the body is never run.

Side Effects

Side effects are those of:

  • each evaluation of testexpr,
  • each evaluation of the body forms during iterations that occur.

Exceptional Situations

Malformed syntax is erroneous.

Availability

  • AutoCAD 2026: documented (per Autodesk reference page).
  • BricsCAD V26: presumed compatible (no contradicting page found).
  • Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.

Source Notes