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
* 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.
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
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/
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
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
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
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/
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
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/
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
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/