Sam Steingold <···@usa.net> writes:
> 5. ... Is there such thing as public/private slot
> paradigm?
As others have already mentioned, you can use the package system to do
some of this.
I just wanted to point out that Graham's "ANSI Common Lisp" book has
an example that makes the slots completely inaccessible. I think it
basically gensyms the slot names so that only the class has access to
the slots. Never tried it out though.
Ray
In article <··············@rtp.ericsson.se> Raymond Toy <···@rtp.ericsson.se> writes:
Sam Steingold <···@usa.net> writes:
> 5. ... Is there such thing as public/private slot
> paradigm?
As others have already mentioned, you can use the package system to do
some of this.
I just wanted to point out that Graham's "ANSI Common Lisp" book has
an example that makes the slots completely inaccessible. I think it
basically gensyms the slot names so that only the class has access to
the slots. Never tried it out though.
class-slots (mentioned in AMOP) returns (at least in lispworks) the slots
of a class...
Sunil
·······@northside.cc.gatech.edu (Sunil Mishra) writes:
> class-slots (mentioned in AMOP) returns (at least in lispworks) the slots
> of a class...
yes, but notice that what is returned is the list of "effective slot
definition metaobjects", not the list of slot names.
If you need to get a list of the slot _names_, this should be according
to the MOP spec, I guess, and works under Allegro CL 4.3.1/unix:
(mapcar #'clos:slot-definition-name
(clos:class-slots (find-class 'myclass)))
--
regards,
Espen Vestre
Telenor Nextel
Norway