Dispatch Using EQL
Applies to program constants
(defmethod distance ((from (eql :origin)) (to t))
(distance (make-instance 'point :x 0 :y 0) to))
> (distance :origin (make-instance 'point :x 3 :y 4))
5
Previous slide
Next slide
Back to first slide
View graphic version