How to find all classes within a category?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to find all classes within a category?

Alex Schenkman
Hi list,

How do I find all classes belonging to a category?
I could go through the Smalltalk dictionary, but I'm sure there is a better way, :-)

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: How to find all classes within a category?

Marcus Denker-4

On Jun 30, 2011, at 3:59 PM, Alex Schenkman wrote:

> Hi list,
>
> How do I find all classes belonging to a category?
> I could go through the Smalltalk dictionary, but I'm sure there is a better way, :-)
>

Everything related to Categories is strange. (this is code from the 70ties... it violates
the "principle of the least surprise" as often as possible  by being done exactly as you
would not do it if you would implement it...

SystemOrganization listAtCategoryNamed: 'Files-System'

SystemOrganization here is a global pointing ot one instance of SystemOrganizer.

This, of course, returns not the classes (this would be too easy), bit symbols equal to the class
names (suitable to query Smalltalk globals):

(SystemOrganization listAtCategoryNamed: 'Files-System') collect: [:each | Smalltalk globals at: each]




--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.