type: special form (fsubr) location: built-in source file: xlcont.c Common LISP compatible: yes supported on: all machines
(if <test-expr> <then-expr> [ <else-expr> ] ) <test-expr> - an expression <then-expr> - the THEN-CLAUSE, an expression <else-expr> - the ELSE-CLAUSE, an optional expression
The IF special form evaluates the <test-expr>. If <test-expr> evaluates to a non-NIL value, then <then-expr> is evaluated and returned as the result. If <test-expr> evaluates to NIL and there is an <else-expr>, then the <else-expr> is evaluated and its result is returned. If there is no <else-expr> and <test-expr> evaluates to NIL, then NIL is returned as a result.
(if T (print "will print") ; prints "will print" (print "won't print")) ; (if NIL (print "won't print") ; (print "will print")) ; prints "will print" (if 'a T NIL) ; returns T (if NIL 'nope 'yep) ; returns YEP