A Simple Conditional: IF
You can use IF for a simple if-then-else test
E.g.,
(if (number? x) x
(list x))
IFs can be nested, but then a COND may be better
E.g.,
(if (null? x) NIL
(if (number? x) x
(list x)))
Previous slide
Next slide
Back to first slide
View graphic version