[Ecls-list] Generic-function-method-class not dispatched correctly...
Pascal Costanza
pc at p-cos.net
Sun Sep 2 14:38:54 UTC 2012
Hi,
[Working on an update of Closer to MOP for ECL 12.7.1, which is more work than usual… ;)]
This is a bug in ECL 12.7.1. Here is a transcript to illustrate this:
> (use-package :clos)
T
> (defun ext-generic-function-method-class (gf) (generic-function-method-class gf))
EXT-GENERIC-FUNCTION-METHOD-CLASS
> (compile 'ext-generic-function-method-class)
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
EXT-GENERIC-FUNCTION-METHOD-CLASS
NIL
NIL
> (defclass my-generic-function (standard-generic-function) () (:metaclass funcallable-standard-class))
#<The FUNCALLABLE-STANDARD-CLASS MY-GENERIC-FUNCTION>
> (defmethod generic-function-method-class :after ((gf my-generic-function)) (print :foo))
#<standard-method GENERIC-FUNCTION-METHOD-CLASS (#<The FUNCALLABLE-STANDARD-CLASS MY-GENERIC-FUNCTION>)>
> (defgeneric test (object) (:generic-function-class my-generic-function))
#<my-generic-function TEST>
> (ext-generic-function-method-class #'test)
#<The STANDARD-CLASS STANDARD-METHOD>
> (generic-function-method-class #'test)
:FOO
#<The STANDARD-CLASS STANDARD-METHOD>
The fact that ext-generic-function-method-class is compiled seems to be important here, and it seems that the dispatch is fixed to the methods known at the time it is compiled. But I'm just guessing here…
Pascal
--
Pascal Costanza
More information about the ecl-devel
mailing list