[info-mcl] CLOS keeps on surprising me
Toomas Altosaar
Toomas.Altosaar at hut.fi
Sat Jun 7 07:00:23 CDT 2008
Would have thought that the following would have been caught at compile time.
But I imagine that there is a good reason for only detecting this at run time.
This in 5.1b4.
-----
(defgeneric some-function (x)
(:method (x) (print x) (values))
(:method :before (x) (print :before))
(:method :after (x) (print :after))
(:method :around (x)
(print :around1)
(call-next-method)
(print :around2)
(values))
(:method :BULL (x)
(print :BULL)))
;(some-function 5)
> Error: #<STANDARD-METHOD SOME-FUNCTION :BULL (T)> is an invalid method.
> :BULL is not one of :BEFORE, :AFTER, and :AROUND.
> While executing: CCL::%INVALID-METHOD-ERROR
> Type Command-. to abort.
See the Restarts menu item for further choices.
1 >
;(COMPUTE-APPLICABLE-METHODS #'some-function '(5)) ==>
(#<STANDARD-METHOD SOME-FUNCTION (T)>
#<STANDARD-METHOD SOME-FUNCTION :AFTER (T)>
#<STANDARD-METHOD SOME-FUNCTION :AROUND (T)>
#<STANDARD-METHOD SOME-FUNCTION :BEFORE (T)>
#<STANDARD-METHOD SOME-FUNCTION :BULL (T)>)
More information about the info-mcl
mailing list