[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New CLISP version



Matthias Lindner <matthias@intellektik.informatik.th-darmstadt.de> writes

> I think the built-in C-function sys::%make-instance does not call
> initialize-instance on the newly created object. The wrapping lisp-function
> clos:make-instance does not accept any keyword arguments, that are not
> defined as :initarg-options to slot definitions in clos:defclass.

Yes, this is the current behaviour. I noted in impnotes.txt:

MAKE-INSTANCE does not call INITIALIZE-INSTANCE and SHARED-INITIALIZE, but does
everything itself. Defining methods on INITIALIZE-INSTANCE or SHARED-INITIALIZE
therefore does not modify the behaviour of MAKE-INSTANCE.

> Is this a bug, or did I misinstall something?

You may call it a bug. I chose this approach to reduce the costs of calling
MAKE-INSTANCE. For now, it's 1 generic function call and dispatch and 2
built-in function calls. If MAKE-INSTANCE is required to go through
INITIALIZE-INSTANCE and SHARED-INITIALIZE, the costs will be at least 3 GF
calls and about 10 other function calls. Unless I do some ugly hacks,
modifying #'MAKE-INSTANCE every time a method is added to
#'INITIALIZE-INSTANCE or #'SHARED-INITIALIZE.

What is common practice in CLOS programs? Are methods for INITIALIZE-INSTANCE
frequent or not? What about methods for SHARED-INITIALIZE ?


                    Bruno Haible
                    haible@ma2s2.mathematik.uni-karlsruhe.de