User Tools

Site Tools


ch2_1_unless

UNLESS

UNLESS is another simple LISP macro built on IF. In LabLISP, UNLESS is implemented as a special form. Accepts any number of arguments. The first argument - the condition - is evaluated and if it is NIL, all the remaining forms are evaluated and result of the last one is returned, as in PROGN. If the condition is not NIL, the rest is ignored and when returns NIL.

(unless c f1 f2 f3)            ; syntax of UNLESS
 
(if (not c) (progn f1 f2 f3))  ; equivalent construction with IF

See also IF, PROGN, WHEN, AND, OR

ch2_1_unless.txt · Last modified: 2022/02/24 13:47 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki