References: 88-002R p.1-41
Related issues: LOAD-OBJECTS
Edit history: 30-Apr-90, Version 1 by Moon
The function page for the generic function ALLOCATE-INSTANCE was
accidentally omitted from 88-002R.
Add a generic function ALLOCATE-INSTANCE that takes one required
argument, a class, plus initialization arguments, and returns one value,
a freshly created instance of the given class. The class argument must
be an actual class, not a class name, and must not be a built-in class.
The object returned by ALLOCATE-INSTANCE is "uninitialized"; when the
class is a standard class, this means the slots are unbound; when the
class is a structure class, this means the slots' values are unspecified.
Common Lisp does not specify how to add methods to ALLOCATE-INSTANCE;
this capability might be added by the Metaobject Protocol.
This is Symbolics issue #32 and Loosemore's issue #6 of 27 Feb 90.
(DEFCLASS MYCLASS () (A B C))
(ALLOCATE-INSTANCE (FIND-CLASS 'MYCLASS))
(SLOT-BOUNDP * 'B) => NIL
Some of the authors of 88-002R say the omission of ALLOCATE-INSTANCE was
simply a mistake. Note that LOAD-OBJECTS:MAKE-LOAD-FORM assumes the
existence of ALLOCATE-INSTANCE and that user-written MAKE-LOAD-FORM
methods that return two values will typically use ALLOCATE-INSTANCE in
the first value.
Symbolics Genera 8.0 does not provide ALLOCATE-INSTANCE (although
it does exist in an internal package). Lucid 4.0.0 Beta-1 provides
Cost to Implementors:
Any CLOS implementation needs ALLOCATE-INSTANCE or something like it
internally, so implementing this proposal is largely a matter of
exporting the symbol from the COMMON-LISP package and documenting it.
Cost to Users:
Cost of non-adoption:
MAKE-LOAD-FORM would be considerably less useful.
None other than the impact of adding a symbol to the COMMON-LISP package.
Missing piece of CLOS provided.