[self-interest] Reflection
Jecel Assumpcao Jr
jecel at merlintec.com
Mon Jun 17 21:42:02 UTC 2002
On Monday 17 June 2002 15:00, Thorsten Dittmar wrote:
> Does anybody know how I can get all methods (as a list of strings or
> mirrors) which an object can understand. I try to find something in
> the system, but the only thing that I found was at traits
> findSlotEnumrationMorph action and for that method is was to stupid.
> I looked at browse, browseWellKnown, mirrors but maybe I was blind.
> Can anybody help?
Try this expression on a mirror of the object you are interested in (I
got one with "reflect: list copy" to do some experiments on):
((slotsInMeAndAncestorsUpTo: self)
copyMappedBy: [ | :m | m name ]) asSet
This was executed in the mirror on the list and the expression in the
first list returned a list with 705 elements, which 'asSet' reduced to
680 since the first expression had also returned ancestor slots that
were overridden.
-- Jecel
More information about the Self-interest
mailing list