Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

unless

unless

type: special form (fsubr)
location: built-in
source file: xlcont.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(unless <test> [ <expr> ... ] )
        <test>          -       an expression - NIL or non-NIL
        <expr>          -       expressions comprising a body of code

DESCRIPTION

The UNLESS macro executes the <expr> forms if <test> evaluates to a NIL value. If <test> is NIL, the value of the last <expr> is returned as the result. If <test> is non-NIL, NIL is returned with none of <expr> evaluated.

EXAMPLES

(unless NIL)                            ; returns NIL
(unless T)                              ; returns NIL
(unless NIL (print "hi") 'foo)          ; prints  "hi"  returns FOO
(unless (listp "a")                     ;
      (print "not a list"))             ; prints  "not a list"
                                        ; returns "not a list"


Go to the first, previous, next, last section, table of contents.