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
testexprevaluates 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
- [while (AutoLISP)](https://help.autodesk.com/cloudhelp/2018/ENU/AutoCAD-AutoLISP-Reference/files/GUID-E7C900DB-8B66-4109-BEF6-B0A18E8CF6B6.htm)
- Status: documented in core behavior; concise here.