Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#267 DEFGENERIC doesn't create methods on same pass as creating generics

HEAD
open
nobody
None
1
2014-09-23
2013-07-26
Patrick Stein
No

If you put the following snippet in a file and (LOAD ...) it or (COMPILE-FILE ...) it & (LOAD ...) the FASL:

(unless (fboundp 'foo)
  (defgeneric foo ()
    (:method () :foo)))

(defgeneric bar ()
  (:method () :bar))

Then, both (FDEFINITION 'FOO) and (FDEFINITION 'BAR) refer to generic functions, but #'FOO has no methods attached to it.

I'm not sure if this is technically permissible by the CLHS, but it is unexpected. CCL, SBCL, ABCL, CMUCL, and CLISP all end up with #'FOO having a method defined on it.

Discussion


Anonymous


Cancel   Add attachments