From: Gerd M. <ger...@t-...> - 2003-06-17 09:29:02
|
William Harold Newman <wil...@ai...> writes: > > >I'd like to patch the > > >(COMPUTE-EFFECTIVE-METHOD SHORT-METHOD-COMBINATION T) method either > > >with a NO-APPLICABLE-METHOD call or with a comment recording once and > > >for all why it can't be done. > > > > > >When I do > > > (defgeneric foo (x)) > > > (defmethod foo :around ((x integer)) (+ 1 x)) ; never does > > > CALL-NEXT-METHOD > > > (foo 12) > > >in sbcl-0.8.0.72 it fails: "There is no primary method...". > > > > Section 7.6.6.2, paragraph 15: "In standard method combination, if there > > is an applicable method but no applicable primary method, an error is > > signaled." > > OK, it's even in the same section as what I quoted.:-( > > Now I guess I'll just put the citations to the standard into the > comments at the code which I found confusing, and wonder why ANSI did > this thing. Just wanted to add one thing... Your example above uses standard method combination, but you also say you'd like to patch a method for SHORT-METHOD-COMBINATION. That method is used for the short form of DEFINE-METHOD-COMBINATION, which includes the standardized method combinations like PROGN, LIST, etc. For these short method combination cases, the description of DEFINE-METHOD-COMBINATION says that an error should be signaled: A method combination procedure defined in this way recognizes two roles for methods. A method whose one qualifier is the symbol naming this type of method combination is defined to be a primary method. At least one primary method must be applicable or an error is signaled. |