if
performs simple branching
Usage:
(if pred then else?)
If the evaluated predicate is truthy (not #f (false) or the empty list), the then form is evaluated and returned, otherwise the else form, if any, will be evaluated and returned.
An Example
(define x '(1 2 3 4 5 6 7 8))
(if (> (length x) 3)
"x is big"
"x is small")
If the symbol unless
is used instead of if
, then the logical branching will be inverted.