:argument-precedence-order
(defmethod foo ((a list) b)
(format t "Arg 1 ~S is a list~%" a))
(defmethod foo (a (b number))
(format t "Arg 2 ~S is a number~%" b))
(foo '(1 2 3) nil)
Arg 1 (1 2 3) is a list
(foo 'a 10)
Arg 2 10 is a number
(foo '(1 2 3) 10)
Arg 1 (1 2 3) is a list
(defgeneric foo (a b) (:argument-precedence-order b a))
(foo '(1 2 3) 10)
Arg 2 10 is a number
Previous slide
Next slide
Back to first slide
View graphic version