From: Robert Rist
Subject: class-slots undefined
Date: 
Message-ID: <5rmeid$65o@data.socs.uts.EDU.AU>
    I just tried to get a list of the slots in a class,
using the function class-slots described in "The Art of the
MetaObject Protocol" (Kiczales, Rivieres & Bobrow), pp. 50
and 214.

    I am using Macintosh CLOS 3.0, and I get an error message
saying that function class-slots in undefined. Can anyone
tell me how I can get a list of the slots in a class?
-- 
Robert Rist
Computing Sciences, University of Technology, Sydney
PO Box 123 Broadway, Sydney, NSW 2007 Australia

From: David Duff
Subject: Re: class-slots undefined
Date: 
Message-ID: <duff-3007971610580001@daved-mac.mitre.org>
In article <··········@data.socs.uts.EDU.AU>, ····@socs.uts.EDU.AU (Robert
Rist) wrote:

>    I just tried to get a list of the slots in a class,
>using the function class-slots described in "The Art of the
>MetaObject Protocol" (Kiczales, Rivieres & Bobrow), pp. 50
>and 214.
>
>    I am using Macintosh CLOS 3.0, and I get an error message
>saying that function class-slots in undefined. Can anyone
>tell me how I can get a list of the slots in a class?

the metaobject protocol is not part of the common lisp standard.  so
you'll find implementations which support clos but which don't support the
mop.  typically, in such cases, you can hunt around and find an internal
function that implements what you are looking for.  

but basically, it's important to keep in mind that the mop is just a
proposal, not a standard, and thus you can't rely on code that you write
using mop to be easily portable.

-- 
David A. Duff
The MITRE Corporation
AI Technical Center
703-883-7731
····@mitre.org
From: Vassili Bykov
Subject: Re: class-slots undefined
Date: 
Message-ID: <870304791.5485@dejanews.com>
In article <··········@data.socs.uts.EDU.AU>,
  ····@socs.uts.EDU.AU (Robert Rist) wrote:
>
>
>     I just tried to get a list of the slots in a class,
> using the function class-slots described in "The Art of the
> MetaObject Protocol" (Kiczales, Rivieres & Bobrow), pp. 50
> and 214.
>
>     I am using Macintosh CLOS 3.0, and I get an error message
> saying that function class-slots in undefined. Can anyone
> tell me how I can get a list of the slots in a class?

MOP is not a part of the CL standard and implementations do not have
to provide it even though many (not MCL) do.
You can use PCL if you need MOP.

--Vassili

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
From: Barry Margolin
Subject: Re: class-slots undefined
Date: 
Message-ID: <5rov0r$lc5@pasilla.bbnplanet.com>
In article <··············@dejanews.com>,
Vassili Bykov  <······@cam.org> wrote:
>MOP is not a part of the CL standard and implementations do not have
>to provide it even though many (not MCL) do.

Also, if an implementation provides the MOP, they may put it in an
implementation-specific package, to avoid running afoul of the restrictions
on the COMMON-LISP package in ANSI CL.

-- 
Barry Margolin, ······@bbnplanet.com
BBN Corporation, Cambridge, MA
Support the anti-spam movement; see <http://www.cauce.org/>
From: Donald H. Mitchell
Subject: Re: class-slots undefined
Date: 
Message-ID: <33E8EC42.223E200E@smartproject.com>
Robert Rist wrote:

>     I just tried to get a list of the slots in a class,
> using the function class-slots described in "The Art of the
> MetaObject Protocol" (Kiczales, Rivieres & Bobrow), pp. 50
> and 214...

These used to work, I don't know the current status nor can I guarantee
that they return what you want (i.e., you may have to use different
accessors than the mop to get slot info from the things that get
returned).
#+mcl
(defmethod class-slots ((class standard-class))
  "Retrieves the slot definitions for all slot's of class's instances."
  (declare (type standard-object class))
  (class-instance-slots class))

#+mcl
(defmethod class-slots ((instance standard-object))
  (class-slots (class-of instance)))

#+mcl
(defmethod class-direct-slots ((class standard-class))
  "Retrieves the slot definitions for all slot's of class's instances."
  (declare (type standard-object class))
  (class-direct-instance-slots class))

#+mcl
(defmethod class-direct-slots ((instance standard-object))
  (class-direct-slots (class-of instance)))
--
Donald H. Mitchell, PhD, PMP    ··········@smartproject.com
Proactive Solutions, Inc.       http://home.earthlink.net/~smartproject
412.835.2410                    412.835.2411 (fax)