[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Object creation discussion (at last!)
- To: Daniel L. Weinreb <DLW@ALDERAAN.SCRC.Symbolics.COM>
- Subject: Object creation discussion (at last!)
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Thu, 16 Apr 87 15:18 EDT
- Cc: Common-Lisp-Object-System@sail.stanford.edu
- In-reply-to: <870416080247.6.DLW@CHICOPEE.SCRC.Symbolics.COM>
Date: Thu, 16 Apr 87 08:02 EDT
From: Daniel L. Weinreb <DLW@ALDERAAN.SCRC.Symbolics.COM>
Date: Thu, 16 Apr 87 00:22 EDT
From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
If multiple initargs that fill the same slot are supplied, which value ends up
in the slot is indeterminate.
In what sense do you mean "indeterminate"? Do you mean "defined to be
one of those values, but not defined as to which of them", such that it
would be legal to use a random number generator to decide?
Yes. "which value" should be "which of those values". I certainly won't complain
if someone proposes a determinate action here instead.
The :default-initargs defclass option is followed by alternating initarg
names and forms.
This syntax is a little bit strange, because usually, in Common Lisp, a
"variable" and the form that specifies the initial value of the
"variable" are kept close together, textually. LET and DEFSTRUCT are
both examples. The now-documented :initform works that way too. What
is the motivation for moving these forms into a defclass option?
This is typically used to specify a default for an initarg defined by a
superclass.
Note that the places that define initargs (the :initarg slot option and the
&key lambda-lists of initialize-instance and allocate-instance) already have
a local defaulting mechanism. :default-initargs is provided specifically
for non-local defaulting.
The class-initargs function takes a class and returns a list of initarg-name
symbols. These are all of the initargs accepted by make-instance of that class.
How does it know all the initargs that are accepted, without
"understanding" the code of every initialize-instance method?
It understands the lambda-list (not the code) of every initialize-instance and
allocate-instance method. I should have made this clearer.
I updated my file copy of my thoughts to reflect these clarifications.