[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Chap 3 question: Class of allocated instances.
- To: jonl@lucid.com
- Subject: Chap 3 question: Class of allocated instances.
- From: Patrick Dussud <dussud@lucid.com>
- Date: Wed, 12 Apr 89 09:49:33 PDT
- Cc: common-lisp-object-system@sail.stanford.edu
- In-reply-to: Jon L White's message of Tue, 11 Apr 89 23:31:52 PDT <8904120631.AA19866@bhopal>
- Reply-to: Common-Lisp-Object-System-mailer@SAIL.Stanford.EDU
Date: Tue, 11 Apr 89 23:31:52 PDT
From: Jon L White <jonl>
I'm wondering why one can't count on the following being true:
(eq (find-class 'foo) (class-of (allocate-instance 'foo)))
This is too restrictive, I think. Flavors defines some mechanisms where this
wouldn't be true. I know these machanisms are used in customer code.
Presumably, if a programmer defined a method on 'allocate-instance'
he could have it return any old sort of widget (rather than a "foo").
Is this useful? Is it still useful if the constraint is added that
(subtype (class-of (allocate-instance 'foo)) 'foo)
This looks more reasonnable. However I don't know if it gives a tremendous
performance leverage for implementation to impose this restriction on all
metaclasses. I would like to see an argumentation before putting this
restriction (consistency of meta concepts, performance optimizations....,
flexibility of extension, less built-in assumptions....)
Patrick.