Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

standard-object

2 views
Skip to first unread message

Vladimir Zolotykh

unread,
Dec 6, 2001, 8:41:46 AM12/6/01
to
Conider the following from CLHS about the standard-object:

"The class standard-object is an instance of standard-class
and is a superclass of every class that is an instance of standard-class
except itself."

No question about

(typep (find-class 'standard-object) 'standard-class) => t

But what is the correct (conforming) result for:

(subtypep 'standard-class 'standard-object) ?

ACL and CMUCL seems to disagree here.

Also I read in OOCL by S. Slade (pp. 518)

"standard-object - Subclass of T. It is the direct superclass of
standard-class, standard-method, and standard-generic-function."

And for arbitrary class foo

(defclass foo () ())

cl-user(169): (subtypep 'foo 'standard-object)
t
t
cl-user(170): (typep (find-class 'foo) 'standard-class)
t

Doesn't this imply that some relation should exist between
standard-object and standard-class ?

Would you mind to clarify this a bit more detail ?

--
Vladimir Zolotykh gsm...@eurocom.od.ua

Barry Margolin

unread,
Dec 6, 2001, 10:48:10 AM12/6/01
to
In article <3C0F759A...@eurocom.od.ua>,

Vladimir Zolotykh <gsm...@eurocom.od.ua> wrote:
>Conider the following from CLHS about the standard-object:
>
>"The class standard-object is an instance of standard-class
>and is a superclass of every class that is an instance of standard-class
>except itself."
>
>No question about
>
> (typep (find-class 'standard-object) 'standard-class) => t
>
>But what is the correct (conforming) result for:
>
> (subtypep 'standard-class 'standard-object) ?
>
>ACL and CMUCL seems to disagree here.

CLHS says that the class precedence list is: standard-class, class,
standard-object, t

This implies that the result should be T.

>Also I read in OOCL by S. Slade (pp. 518)
>
>"standard-object - Subclass of T. It is the direct superclass of
>standard-class, standard-method, and standard-generic-function."

According to CLHS, it's not actually the direct superclass, since CLASS is
in between them.

>And for arbitrary class foo
>
> (defclass foo () ())
>
>cl-user(169): (subtypep 'foo 'standard-object)
>t
>t
>cl-user(170): (typep (find-class 'foo) 'standard-class)
>t
>
>Doesn't this imply that some relation should exist between
>standard-object and standard-class ?

Not really. If the language didn't specify the relation as I described
above, it would be permissible for standard-class to be a subclass of some
implementation-dependent class. In fact, allowing this might make things
easier for implementors, because it can make it easier to bootstrap CLOS
and avoids some tricky infinite regress issues.

--
Barry Margolin, bar...@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

0 new messages