From: Jim Newton
Subject: superclasses of and subclasses of
Date: 
Message-ID: <2so66oF1n1mv1U1@uni-berlin.de>
the SKILL language has the functions subclassesOf and superclassesOf
which calculate the subclasses and superclasses.  superclasses are given
from most specific to least specific.

How can i do this in common lisp?

-jim

From: Kenny Tilton
Subject: Re: superclasses of and subclasses of
Date: 
Message-ID: <QFB9d.69932$Ot3.5206@twister.nyc.rr.com>
Jim Newton wrote:
> the SKILL language has the functions subclassesOf and superclassesOf
> which calculate the subclasses and superclasses.  superclasses are given
> from most specific to least specific.
> 
> How can i do this in common lisp?

It varies between implementations because the so-called meta-object 
protocol underlying CLOS did not make it into the spec.

AllegroCL offers class-direct-subclasses and class-direct-superclasses. 
The class-precedence-list function (which did make it into the spec) 
will let you figure out indirect superclasses by process of elimination.

MCL was similar, but there was one difference I encountered switching 
between the two. Forget what.

btw, an overall pointer: I checked my recall on this in AllegroCL with 
(apropos 'classes). apropos is great in situations like this where you 
are pretty much at sea but can guess at part of the name a function (or 
class or global var or any other symbol would have. Looks across all 
packages as well.

kenny

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: Pascal Costanza
Subject: Re: superclasses of and subclasses of
Date: 
Message-ID: <ck6obs$2hs$1@newsreader2.netcologne.de>
Jim Newton wrote:
> the SKILL language has the functions subclassesOf and superclassesOf
> which calculate the subclasses and superclasses.  superclasses are given
> from most specific to least specific.
> 
> How can i do this in common lisp?

This depends on what you mean by "calculate". The CLOS MOP provides two 
introspection fuctions called class-direct-superclasses and 
class-direct-subclasses. You need to determine the transitive closure by 
hand.

The function that actually determines the class precedence list is 
compute-class-precedence-list. You can get it, once it's computed, via 
class-precedence-list. It's also sorted from most specific to least 
specific, according to the rules of the metaclass.


Pascal

-- 
Tyler: "How's that working out for you?"
Jack: "Great."
Tyler: "Keep it up, then."
From: Jim Newton
Subject: Re: superclasses of and subclasses of
Date: 
Message-ID: <2so8ugF1oa7lgU1@uni-berlin.de>
in cmucl i see that both of these functions are undefined.
compute-class-precedence-list and class-precedence-list.


Pascal Costanza wrote:
> 
> Jim Newton wrote:
> 
>> the SKILL language has the functions subclassesOf and superclassesOf
>> which calculate the subclasses and superclasses.  superclasses are given
>> from most specific to least specific.
>>
>> How can i do this in common lisp?
> 
> 
> This depends on what you mean by "calculate". The CLOS MOP provides two 
> introspection fuctions called class-direct-superclasses and 
> class-direct-subclasses. You need to determine the transitive closure by 
> hand.
> 
> The function that actually determines the class precedence list is 
> compute-class-precedence-list. You can get it, once it's computed, via 
> class-precedence-list. It's also sorted from most specific to least 
> specific, according to the rules of the metaclass.
> 
> 
> Pascal
> 
From: Thomas F. Burdick
Subject: Re: superclasses of and subclasses of
Date: 
Message-ID: <xcvzn2x56uf.fsf@conquest.OCF.Berkeley.EDU>
Jim Newton <·····@rdrop.com> writes:

> in cmucl i see that both of these functions are undefined.
> compute-class-precedence-list and class-precedence-list.

They should both be there, in CMUCL in the mop package, and in SBCL in
the sb-mop package.
From: Edi Weitz
Subject: Re: superclasses of and subclasses of
Date: 
Message-ID: <uekk9j8bp.fsf@agharta.de>
On Fri, 08 Oct 2004 20:43:59 +0200, Jim Newton <·····@rdrop.com> wrote:

> in cmucl i see that both of these functions are undefined.
> compute-class-precedence-list and class-precedence-list.

  ···@miles:~$ cmucl
  ; Loading #p"/home/edi/.cmucl-init".
  * (apropos "class-precedence-list")

  PCL::EARLY-CLASS-PRECEDENCE-LIST [function] (class)
  PCL:CLASS-PRECEDENCE-LIST [function] 
  PCL:COMPUTE-CLASS-PRECEDENCE-LIST [function] 
  KERNEL:STD-COMPUTE-CLASS-PRECEDENCE-LIST [function] (class)

Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")