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.


Reply via email to