From: Slobodan Blazeski
Subject: class-name
Date: 
Message-ID: <b86d8edd-6c5b-4355-989d-e6fbf7ad25a2@l32g2000hse.googlegroups.com>
What's class-name used for? If I need just the symbol that represents
the class why not :
(type-of x)
RICH-TEXT-EDITOR
instead of
(class-name (class-of x))
RICH-TEXT-EDITOR

or class-name is planned to be specialized to return something else
for specific classes?

cheers
Slobodan
From: Pascal Costanza
Subject: Re: class-name
Date: 
Message-ID: <5thjsdF1dqg9cU1@mid.individual.net>
Slobodan Blazeski wrote:
> What's class-name used for? If I need just the symbol that represents
> the class why not :
> (type-of x)
> RICH-TEXT-EDITOR
> instead of
> (class-name (class-of x))
> RICH-TEXT-EDITOR
> 
> or class-name is planned to be specialized to return something else
> for specific classes?

Types and classes are not the same. By default, Common Lisp provides 
'more' types than classes - some types are not available as distinct 
classes, but only as subtypes of those classes.

Furthermore, not all class names are types, but only 'proper' class 
names. A class with a proper name is a class where for a given name, 
(find-class name) returns that class, and (class-name class) returns 
that name.

You can find the details of how types and classes are integrated in 
Section 4.3.7 of the HyperSpec.

You can find a rationale for the design in Section 2.2 of "CLOS in 
Context: The Shape of the Design Space" by Bobrow, Gabriel and White - 
see http://www.dreamsongs.com/Files/clos-book.pdf


Pascal

-- 
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/