Enclosed is a fileout of a sample collection named DelegatedSet that works by 
delegating to an instance of Set stored in an instance variable. It implements 
the basic protocol Collection requires, including #add:, #remove:ifAbsent: and 
#do: as well as some additional messages, all through delegation. Create an 
instance of it and then inspect that instance with NewInsepctor, and you will 
notice the "Elements" item does not work. Nothing happens when you click it. To 
inspect the elements, you need to click "set," the instance variable containing 
the Set, and then inspect that object further. Apparently, unless you override 
one or more messages under the extension category *Newinspector, NewInspector 
will not know how to inspect your collection properly. Worse, as soon as you do 
implement those methods, unless you change their category, they will now be 
considered part of the *Newinspector package rather than the package your 
collection belongs to and will not be saved along with the collection.

I think at a minimum, any collection understanding #do: and #size should be 
inspectable by NewInspector.

Attachment: DelegatedSet.st
Description: Binary data

Reply via email to