COND cont’d
Tests are evaluated in sequence until the evaluation of one of them returns true (i.e., not nil)
The last test may be the symbol t
(cond ((= x 1) (print 'single))
((= x 2) (print 'twin)
(print "You WIN"))
((= x 3) (print 'triplet))
(t (print 'unknown) (print "Too Bad") x))
Previous slide
Next slide
Back to first slide
View graphic version