[Ecls-list] Problems with call-next-method?!?
Pascal Costanza
pc at p-cos.net
Thu Mar 13 23:44:32 UTC 2008
Hi,
In my attempt to get ECL running with gcc 4.3.0, I stumbled upon a
different problem that seems to be unrelated to the new version of
gcc. At least, the following seems to occur with gcc 4.0.1 (on a
PowerBook G4 with Mac OS X 10.5.2) as well.
In my .eclrc, I (require :asdf) and immediately load a file that
modifies some of the ASDF generic functions.
One of the methods looks like this:
(defmethod asdf:perform :around ((o asdf:load-op) (c asdf:cl-source-
file))
(handler-case (call-next-method o c)
(error ()
(asdf:perform (make-instance 'asdf:compile-op) c)
(call-next-method)))))
[This is to ensure that erroneous loads of a system trigger a
recompilation, which is handy when moving from one version of a CL
implementation to another and compiled files of the old version can't
be loaded anymore.]
The first call-next-method seems to work correctly, but the second
seems to signal an error. (This is independent of the arguments
explicitly passed to call-next-method, they are just there to fix some
problem with yet another CL implementation.)
I have added the following definition to get some useful debugging
output:
(defmethod asdf:perform :around ((o asdf:load-op) (c asdf:cl-source-
file))
(let ((clos::*next-methods*
(loop for method in clos::*next-methods*
collect (lambda (&rest args)
(format t "next method called with ~S.~%" args)
(apply method args)))))
(handler-case (call-next-method o c)
(error ()
(asdf:perform (make-instance 'asdf:compile-op) c)
(call-next-method)))))
Here is an example:
> (asdf:oos 'asdf:load-op :lw-compat)
; loading system definition from /Users/costanza/lisp/systems/lw-
compat.asd
; into #<ASDF0 package>
;;; Loading "/Users/costanza/lisp/systems/lw-compat.asd"
; registering #<SYSTEM #:LW-COMPAT 16932464> as LW-COMPAT
next method called with ((#<ASDF:LOAD-OP NIL 16902592>
#<ASDF:CL-SOURCE-FILE "lw-compat-package"
16945296>)
NIL).
;;; Compiling /Users/costanza/lisp/lw-compat/lw-compat-package.lisp.
;;; End of Pass 1.
;;; Note: Emiting FUNCALL for SI::DODEFPACKAGE
;;; Calling the C compiler...
;;; Note: Invoking external command:
;;; gcc -g -O2 -fPIC -fno-common -fstrict-aliasing -Ddarwin -O "-I/
usr/local/include/" -w -c "/Users/costanza/lisp/lw-compat/.ecl/lw-
compat-package.c" -o "/Users/costanza/lisp/lw-compat/.ecl/lw-compat-
package.o"
;;; Note: Invoking external command:
;;; gcc -o "/Users/costanza/lisp/lw-compat/.ecl/lw-compat-package.fas"
-L"/usr/local/lib/" "/Users/costanza/lisp/lw-compat/.ecl/lw-compat-
package.o" -bundle -lecl -lm -lgmp
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;; Finished compiling /Users/costanza/lisp/lw-compat/lw-compat-
package.lisp.
next method called with (#<frame 2 9> NIL).
Wrong number of arguments passed to an anonymous function
Broken at EVAL.Available restarts:
[...]
It seems to me that the arguments printed in the second call to call-
next-methods are wrong.
Any ideas?
It seems to be hard to reproduce this problem, my guess is that the
problem is not in CLOS, but somewhere else...
Best,
Pascal
--
1st European Lisp Symposium (ELS'08)
http://prog.vub.ac.be/~pcostanza/els08/
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium
More information about the ecl-devel
mailing list