Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!unreplyable!garbage From: jonl@LUCID.COM (Jon L White) Newsgroups: comp.lang.clos Subject: Accessing Class Slots Message-ID: <9102272209.AA09488@kolyma> Date: 27 Feb 91 22:09:27 GMT References: <1991Feb25.214049.29326@msuinfo.cl.msu.edu> Sender: welch@tut.cis.ohio-state.edu Distribution: inet Organization: CommonLoops Lines: 16 re: Does any one know if there is a way in standard CLOS to access the value of a class-allocated slot given the class (and not an instance of it)? The 1988 CLOS spec certainly doesn't provide such a capability, and the emerging metaobject protocols do not do so either. However, in the previously-alluded "introspective" subset of the metaobject protocol I believe there is a function CLOS:CLASS-PROTOTYPE, and you can use that as a quick way to get an instance without consing up a fresh one each time. E.g., (defun shared-slot-value (class slot-name) (slot-value (clos:class-prototype class) slot-name)) -- JonL --