Adding Categories to Classes in Pharo 9.0 (Smalltalk)
I've very recently started learning Pharo Smalltalk and my first assignment requires me to add three categories to a class, but the problem is that any information I find on the web is written before 2014, and the options are just not there anymore. How can I add categories to classes in Pharo 9.0?
Solution 1:
I presume that the assignment consists in adding categories programmatically. In that case, this is how you could learn how to add a category.
- Find the class you want to add the category to
- Inspect the class and take a look to its instvars
- The categories of the class should be there somehow
- The ivar whose name looks promising is
organization
- Its class is
ClassOrganizer
- Check to see whether there is a
ClassOrganizerTest
for testing it - Found! Take a look at the tests and see if you can find what you are looking for.