[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Help with CLOS slots
Date: Tue, 11 Sep 1990 15:42 EDT
From: sims@starbase.MITRE.ORG (Jim Sims)
I'd like to write a WITH-ALL-YOUR-ACCESSORS macro for those
methods that will access most of the slots of a class, just using
their regular names, instead of typing them all to WITH-ACCESSORS...
I can't seem to locate a function call combination to get just the
NAMES of the slots defined for a class - CLOS::CLASS-SLOTS gets the slot
descriptors, but the NAME is internal to the descriptor and I haven't come
on a convenient way to get at it.
jim
(mapcar #'clos:slot-definition-name (clos:class-slots (clos:find-class class)))
Make sure the class definition has been loaded before you try to do
this, since the information about the slot names isn't kept in the
compilation environment.