[Ecls-list] Important fix in CLOS

Juan Jose Garcia Ripoll worm at arrakis.es
Wed Apr 30 01:04:14 UTC 2003


This code (I did not find an equivalent in Paul's test suite) works now

> (flet ((foo () (print 'good) (cos 1.0)))
    (defclass foo-class () ((a :initform (foo)))))
#<The STANDARD-CLASS FOO-CLASS>
> (slot-value (make-instance 'foo-class) 'a)

GOOD
0.5403023

The idea is that :INITFORM is evaluated in the lexical environment in which 
the DEFCLASS appears. To achieve this effect, one has to enclose the '(FOO) 
form in a closure, like #'(lambda () (FOO)) and evaluate it at 
INITIALIZE-INSTANCE time. Same applies for :DEFAULT-INITARGS.

I also fixed the inline expanders for = and /=.

Juanjo





More information about the ecl-devel mailing list