;;; CLOS 4: DISPATCH ON A VALUE (solution) (defgeneric serve (customer)) (defmethod serve (customer) "one espresso") (defmethod serve ((customer (eql 'vip))) "a free muffin too") ;;; ------------------------------------------------------------------ ;;; Checks. Read them - they tell you what to aim for - but leave ;;; them unchanged. ;;; ------------------------------------------------------------------ (check-equal "a free muffin too" (serve 'vip)) (check-equal "one espresso" (serve 'ada))