From: Ron Garret
Subject: Extracting class slot names
Date: 
Message-ID: <rNOSPAMon-E37E7B.15101115122008@news.gha.chartermi.net>
Is there a portable way to get a list of the names of all the slots in a 
class?  I know about class-slots (and class-direct-slots) but these 
return (apparently) opaque slot-definition objects from which the name 
cannot be portably extracted.

Thanks,
rg

From: Marcus Breiing
Subject: Re: Extracting class slot names
Date: 
Message-ID: <k0tvmt4zjw6ce@breiing.com>
* Ron Garret

> I know about class-slots (and class-direct-slots) but these return
> (apparently) opaque slot-definition objects from which the name
> cannot be portably extracted.

Try to call SLOT-DEFINITION-NAME on these objects, which should be
about as (non-)portable as CLASS-SLOTS itself.
From: Ron Garret
Subject: Re: Extracting class slot names
Date: 
Message-ID: <rNOSPAMon-AB92C1.15441415122008@news.gha.chartermi.net>
In article <·············@breiing.com>,
 Marcus Breiing <······@2008w49.mail.breiing.com> wrote:

> * Ron Garret
> 
> > I know about class-slots (and class-direct-slots) but these return
> > (apparently) opaque slot-definition objects from which the name
> > cannot be portably extracted.
> 
> Try to call SLOT-DEFINITION-NAME on these objects, which should be
> about as (non-)portable as CLASS-SLOTS itself.

Just what I was looking for.  Thanks!

rg
From: Rainer Joswig
Subject: Re: Extracting class slot names
Date: 
Message-ID: <joswig-87C86B.00254016122008@news-europe.giganews.com>
In article <·······························@news.gha.chartermi.net>,
 Ron Garret <·········@flownet.com> wrote:

> Is there a portable way to get a list of the names of all the slots in a 
> class?  I know about class-slots (and class-direct-slots) but these 
> return (apparently) opaque slot-definition objects from which the name 
> cannot be portably extracted.
> 
> Thanks,
> rg

CL-USER 82 > (defclass foobaz () (a b))
#<STANDARD-CLASS FOOBAZ 402000850B>

CL-USER 83 > (class-direct-slots *)
(#<STANDARD-DIRECT-SLOT-DEFINITION A 412021FACB> #<STANDARD-DIRECT-SLOT-DEFINITION B 412021FAE3>)

CL-USER 84 > (slot-definition-name (first *))
A


I which packages the functions are is implementation
dependent. Also not every implementation
stores slot-information as slot-definition
objects.

-- 
http://lispm.dyndns.org/
From: Ron Garret
Subject: Re: Extracting class slot names
Date: 
Message-ID: <rNOSPAMon-D0A0E9.15445015122008@news.gha.chartermi.net>
In article <····························@news-europe.giganews.com>,
 Rainer Joswig <······@lisp.de> wrote:

> In article <·······························@news.gha.chartermi.net>,
>  Ron Garret <·········@flownet.com> wrote:
> 
> > Is there a portable way to get a list of the names of all the slots in a 
> > class?  I know about class-slots (and class-direct-slots) but these 
> > return (apparently) opaque slot-definition objects from which the name 
> > cannot be portably extracted.
> > 
> > Thanks,
> > rg
> 
> CL-USER 82 > (defclass foobaz () (a b))
> #<STANDARD-CLASS FOOBAZ 402000850B>
> 
> CL-USER 83 > (class-direct-slots *)
> (#<STANDARD-DIRECT-SLOT-DEFINITION A 412021FACB> 
> #<STANDARD-DIRECT-SLOT-DEFINITION B 412021FAE3>)
> 
> CL-USER 84 > (slot-definition-name (first *))
> A
> 
> 
> I which packages the functions are is implementation
> dependent. Also not every implementation
> stores slot-information as slot-definition
> objects.

Just what I needed.  Thanks!

rg
From: Nicolas Edel
Subject: Re: Extracting class slot names
Date: 
Message-ID: <4c943efd-f5a8-46e3-b76f-a26df95a9062@e25g2000vbe.googlegroups.com>
On Dec 16, 12:25 am, Rainer Joswig <······@lisp.de> wrote:
> [...]
> CL-USER 83 > (class-direct-slots *)
>

Sorry for the clearly out of topic question, but any idea where I
could find documentation about this '*' variable ? Hard to google
about '*' or 'start' symbol !

-Nicolas
From: Zach Beane
Subject: Re: Extracting class slot names
Date: 
Message-ID: <m3vdtks75l.fsf@unnamed.xach.com>
Nicolas Edel <············@gmail.com> writes:

> On Dec 16, 12:25 am, Rainer Joswig <······@lisp.de> wrote:
>> [...]
>> CL-USER 83 > (class-direct-slots *)
>>
>
> Sorry for the clearly out of topic question, but any idea where I
> could find documentation about this '*' variable ? Hard to google
> about '*' or 'start' symbol !

http://l1sp.org/cl/* will get you there (most other CL symbols work
too).

Zach
From: Rainer Joswig
Subject: Re: Extracting class slot names
Date: 
Message-ID: <joswig-A9C866.12412216122008@news-europe.giganews.com>
In article <··············@unnamed.xach.com>,
 Zach Beane <····@xach.com> wrote:

> Nicolas Edel <············@gmail.com> writes:
> 
> > On Dec 16, 12:25 am, Rainer Joswig <······@lisp.de> wrote:
> >> [...]
> >> CL-USER 83 > (class-direct-slots *)
> >>
> >
> > Sorry for the clearly out of topic question, but any idea where I
> > could find documentation about this '*' variable ? Hard to google
> > about '*' or 'start' symbol !
> 
> http://l1sp.org/cl/* will get you there (most other CL symbols work
> too).
> 
> Zach

If all fails (no internet connection, no browser, ...) there is
still hope:

CL-USER 103 > (documentation '* 'variable)
"Holds the value of the most recent top-level EVAL."

CL-USER 104 > (documentation 'documentation 'function)
"Returns the documentation string associated with the given object (if any)."

-- 
http://lispm.dyndns.org/
From: Nicolas Edel
Subject: Re: Extracting class slot names
Date: 
Message-ID: <fe2cd912-ae5a-4db6-90e8-ab9087427fe2@a26g2000prf.googlegroups.com>
On Dec 16, 12:41 pm, Rainer Joswig <······@lisp.de> wrote:
> In article <··············@unnamed.xach.com>,
>  Zach Beane <····@xach.com> wrote:
>
> > Nicolas Edel <············@gmail.com> writes:
>
> > > On Dec 16, 12:25 am, Rainer Joswig <······@lisp.de> wrote:
> > >> [...]
> > >> CL-USER 83 > (class-direct-slots *)
>
> > > Sorry for the clearly out of topic question, but any idea where I
> > > could find documentation about this '*' variable ? Hard to google
> > > about '*' or 'start' symbol !
>
> >http://l1sp.org/cl/*will get you there (most other CL symbols work
> > too).
>
> > Zach
>
> If all fails (no internet connection, no browser, ...) there is
> still hope:
>
> CL-USER 103 > (documentation '* 'variable)
> "Holds the value of the most recent top-level EVAL."
>
> CL-USER 104 > (documentation 'documentation 'function)
> "Returns the documentation string associated with the given object (if any)."
>
> --http://lispm.dyndns.org/

It has the meaning I felt it has but wasn't sure whether I was missing
something or not.
Thanks for the documentation howto ;)

-Nicolas
From: Rainer Joswig
Subject: Re: Extracting class slot names
Date: 
Message-ID: <joswig-9593F4.11364516122008@news-europe.giganews.com>
In article 
<····································@e25g2000vbe.googlegroups.com>,
 Nicolas Edel <············@gmail.com> wrote:

> On Dec 16, 12:25�am, Rainer Joswig <······@lisp.de> wrote:
> > [...]
> > CL-USER 83 > (class-direct-slots *)
> >
> 
> Sorry for the clearly out of topic question, but any idea where I
> could find documentation about this '*' variable ? Hard to google
> about '*' or 'start' symbol !
> 
> -Nicolas

* is the last value
** the value before that
*** the value before that

See also  -, + and /

HyperSpec, Symbol Index, Non-Alphabetic

http://www.lispworks.com/documentation/HyperSpec/Front/X_Alph_9.htm


Variable *, **, ***
http://www.lispworks.com/documentation/HyperSpec/Body/v__stst_.htm



When you use LispWorks, c-sh-d on a symbol shows the
documentation for the symbol in a web browser...

-- 
http://lispm.dyndns.org/
From: Nicolas Edel
Subject: Re: Extracting class slot names
Date: 
Message-ID: <3a7d364a-dbd7-4f1f-aa25-c55ba9609dac@a12g2000pro.googlegroups.com>
On Dec 16, 11:36 am, Rainer Joswig <······@lisp.de> wrote:
> In article
> <····································@e25g2000vbe.googlegroups.com>,
>  Nicolas Edel <············@gmail.com> wrote:
>
> > On Dec 16, 12:25 am, Rainer Joswig <······@lisp.de> wrote:
> > > [...]
> > > CL-USER 83 > (class-direct-slots *)
>
> > Sorry for the clearly out of topic question, but any idea where I
> > could find documentation about this '*' variable ? Hard to google
> > about '*' or 'start' symbol !
>
> > -Nicolas
>
> * is the last value
> ** the value before that
> *** the value before that
>
> See also  -, + and /
>
> HyperSpec, Symbol Index, Non-Alphabetic
>
> http://www.lispworks.com/documentation/HyperSpec/Front/X_Alph_9.htm
>
> Variable *, **, ***http://www.lispworks.com/documentation/HyperSpec/Body/v__stst_.htm
>
> When you use LispWorks, c-sh-d on a symbol shows the
> documentation for the symbol in a web browser...
>
> --http://lispm.dyndns.org/

Thanks, I just learned the +, ++ and +++ variables.

-Nicolas
From: Pascal Costanza
Subject: Re: Extracting class slot names
Date: 
Message-ID: <6qosqkFdleeuU1@mid.individual.net>
Ron Garret wrote:
> Is there a portable way to get a list of the names of all the slots in a 
> class?  I know about class-slots (and class-direct-slots) but these 
> return (apparently) opaque slot-definition objects from which the name 
> cannot be portably extracted.
> 
> Thanks,
> rg

(mapcar #'slot-definition-name (class-slots some-class))

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