logo       

PCL call-method-list problem (Was: cmucl-2003-12 breaks asdf inline methods: msg#00081

lisp.cmucl.devel

Subject: PCL call-method-list problem (Was: cmucl-2003-12 breaks asdf inline methods)

It seems like my asdf-problem is really an PCL bug. Here is a
stand-alone replication:

;; foobar.lisp
(defclass foo () ((bar :initform 'bar)))
(defmethod foobar ((foo foo)) 'bar)
(defmethod foobar :after ((foo foo)) (slot-value foo 'bar))
(defmethod foobar :after ((foo (eql (make-instance 'foo)))) (values))
(foobar (make-instance 'foo))

CL-USER> (load "foobar.lisp")
NIL fell through ETYPECASE expression.
Wanted one of (FUNCTION PCL::METHOD-CALL FIXNUM PCL::FAST-METHOD-CALL).
[Condition of type CONDITIONS::CASE-FAILURE]
...

I think the problem is an incoherency between MEMF-TEST-CONVERTER and
MEMF-CODE-CONVERTER (pcl/combin.lisp):

MEMF-TEST-CONVERTER represents any non-all-fast CALL-METHOD-LIST by a
single token disregarding its length while

MEMF-CODE-CONVERTER explicitly expands the corresponding method calls
to its known length.

Due to this problem, LOOKUP-FGEN returns an EMF (?) that expects two
:AFTER-methods even if the actuall call to FOOBAR only picks up one
:AFTER-method

With all possible non-PCL-expert disclaimers, the appended patch seems
to fix the problem.

Regards, Ole


--- src/pcl/combin.lisp.orig 2003-11-06 09:15:54.000000000 +0100
+++ src/pcl/combin.lisp 2004-02-24 11:30:37.757567864 +0100
@@ -514,7 +514,10 @@
(defun memf-test-converter (form gf method-alist-p wrappers-p)
(flet ((method-key (method)
- (if (inlinable-method-p method)
- (method-function-name method)
- '.fast-call-method.)))
+ (cond((inlinable-method-p method)
+ (method-function-name method))
+ ((eq (get-method-call-type gf form method-alist-p wrappers-p)
+ 'fast-method-call)
+ '.fast-call-method.)
+ (t .call-method))))
(case (car-safe form)
;;
@@ -526,8 +529,5 @@
;;
(call-method-list
- (if (eq (get-method-list-call-type gf form method-alist-p wrappers-p)
- 'fast-method-call)
- (mapcar #'method-key (call-method-list-methods form))
- '.call-method-list.))
+ (mapcar #'method-key (call-method-list-methods form)))
;;
(check-applicable-keywords





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise