`(let ((,!form ,form))
(cond
,@(mapcar (lambda (clausule)
- (if (eq (car clausule) t)
- clausule
+ (if (or (eq (car clausule) t)
+ (eq (car clausule) 'otherwise))
+ `(t ,@(cdr clausule))
`((eql ,!form ',(car clausule))
,@(cdr clausule))))
clausules)))))
list* list-all-packages listp loop make-array make-package
make-symbol mapcar member minusp mod multiple-value-bind
multiple-value-call multiple-value-list multiple-value-prog1
- nconc nil not nreconc nth nthcdr null numberp or
+ nconc nil not nreconc nth nthcdr null numberp or otherwise
package-name package-use-list packagep parse-integer plusp pop
prin1-to-string print proclaim prog1 prog2 progn psetq push
quote read-from-string remove remove-if remove-if-not return
(test (= 2 (cond (1 2))))
(test (= 3 (cond (nil 1) (2 3))))
(test (eql nil (cond (nil 1) (nil 2))))
+
+; CASE
+
+(test (= (case 1 (2 3) (otherwise 42)) 42))
+(test (= (case 1 (2 3) (t 42)) 42))
+(test (= (case 1 (2 3) (1 42)) 42))
+(test (null (case 1 (2 3))))