[Ecls-list] Bug-CLOS :default-initargs forms are not evaluated by defclass/make-instance?
John B. Thiel
jbthiel at pobox.com
Sun Jan 6 19:59:02 UTC 2002
It appears that forms in the :default-initargs argument to defclass are
not being evaluated as they should be. As shown in the test case
appended below, both clisp and cmucl yield (0 . 0), whereas ecl
returns the unevaluated cons.
What is the general state of CLOS in ECL? Is it considered
high-performance, robust, stable... or also under development?
-jt
ECL (Embeddable Common-Lisp) 0.5
> (defclass circle ()
((radius :accessor circle-radius :initarg :radius)
(center :accessor circle-center :initarg :center))
(:default-initargs
:radius 1
:center (cons 0 0)))
#<The STANDARD-CLASS CIRCLE>
> (setf cir (make-instance 'circle))
#<a CIRCLE>
> (circle-center cir)
(CONS 0 0)
COMPARE TO:
clisp -q
[1]> (defclass circle ()
((radius :accessor circle-radius :initarg :radius)
(center :accessor circle-center :initarg :center))
(:default-initargs
:radius 1
:center (cons 0 0)))
#<STANDARD-CLASS CIRCLE>
[2]> (setf cir (make-instance 'circle))
#<CIRCLE #x19CB6191>
[3]> (circle-center cir)
(0 . 0)
AND
CMU Common Lisp 18c, Built 2000-11-28, running on excaliber
Loaded subsystems:
Python 1.0, target SPARCstation/Solaris 2
CLOS based on PCL version: September 16 92 PCL (f)
* (defclass circle ()
((radius :accessor circle-radius :initarg :radius)
(center :accessor circle-center :initarg :center))
(:default-initargs
:radius 1
:center (cons 0 0)))
#<STANDARD-CLASS CIRCLE {40028BDD}>
* (setf cir (make-instance 'circle))
Warning: Declaring CIR special.
#<CIRCLE {4002F3ED}>
* (circle-center cir)
(0 . 0)
*
More information about the ecl-devel
mailing list