[Ecls-list] Two bugs in ECL's CLOS implementation
Pascal Costanza
pc at p-cos.net
Wed Nov 25 21:28:49 UTC 2009
Hi,
Currently working on support for Closer to MOP, one minor nit, one that appears to be a showstopper at the moment. Tests are based on the current CVS repository.
Minor nit:
(defclass person ()
((name :initarg :name :reader person-name)
(address :initarg :address :reader person-address)))
(defvar *p*)
(defun test ()
(setq *p* (make-instance 'person :name "Pascal")))
If I compile this, I get a warning that I pass too many arguments to make-instance. This seems to have to do with &rest argument processing.
Showstopper:
> (defgeneric test (a b c))
#<STANDARD-GENERIC-FUNCTION TEST>
> (defmethod test (a b c) (+ a b c))
#<STANDARD-METHOD TEST (#<The BUILT-IN-CLASS T> #<The BUILT-IN-CLASS T>
#<The BUILT-IN-CLASS T>)>
> (test 3 4 5)
12
> (clos:set-funcallable-instance-function #'test (lambda (a b c) (* a b c)))
#<STANDARD-GENERIC-FUNCTION TEST>
> (test 3 4 5)
60
> (defmethod test (a b c) (+ a b c))
Detected access to an invalid or protected memory address.
Available restarts:
[...]
My current guess is that there is a call to something call compute-g-f-spec-list that may cause this, but it's too late now for me to investigate. Maybe somebody else has an obvious idea...
Best,
Pascal
--
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium
More information about the ecl-devel
mailing list