[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: initializing class slots
- To: DLW@ALDERAAN.SCRC.Symbolics.COM
- Subject: Re: initializing class slots
- From: Danny Bobrow <Bobrow.pa@Xerox.COM>
- Date: 4 Feb 87 21:05 PST
- Cc: Bobrow.pa@Xerox.COM, common-lisp-object-system@SAIL.STANFORD.EDU
- In-reply-to: Daniel L. Weinreb <DLW@ALDERAAN.SCRC.Symbolics.COM>'s message of Wed, 4 Feb 87 12:05 EST
- Sender: Bobrow.pa@Xerox.COM
(defclass A () ((s :initform 1 :allocation :class)))
By the way, I could not find anything specific in the document
that says how initforms work for class slots. For example, exactly
when is the initform evaluated? At the time of the evaluating of
the containing defclass?
Yes and No. It is no because it is really at the time the class is
defined. Compiling a file with a defclass will expand the defclass into
something else, and that will evaluate at load time. But for ordinary
loading of files (or evaluating the form in a listener) the answer is
yes.
danny