[Newbies] Added Instance Variables and Methods are not shown in System Browser

Roel Wuyts Roel.Wuyts at ulb.ac.be
Mon Jan 8 10:05:14 UTC 2007

It is possible that you added the class to the method dictionary, but  
not to the categories. When adding a new method to a class there is  
actually two different things to be done:
- adding the method to the method dictionary
- adding the protocol information to the category attached to each  
class. That is basically a dictionary that says which category  
contains what selectors.

Now it all depends on how you implemented your application. When  
using the proper meta-level operation to add a method to a class in a  
certain category, both happen and everything should be ok. Even  
better, open browsers will refresh and should show your newly added  

But from your description I think that you used some other (deeper,  
more fine-grained and fundamental) parts of the meta-level, namely  
the part that only adds the method to the method dictionary. As a  
result your class knows about the method, but your category does not  
(and this is used by the browser). That would explain why you can  
send the corresponding message and see the method in the inspector,  
but not in the browser.

A good starting point to see what happens is in the various kinds of  
#compile:classified methods on Parser or Compiler (sorry, I do not  
have a Squeak on the machine at hand; ping me for specific info and I  
can send you the exact names of all methods involved).

On 07 Jan 2007, at 17:54, Warakorn Paphrawat wrote:

> I developed a little Meta-Programming application, which adds  
> methods to the MethodDictionary of a class and adds instance  
> variables + getters/setters.
> However, after running this application the changes are not  
> reflected in the System Browser.
> All new instance variables and new methods are not shown there.
> On the other side I can run a little test application, which  
> creates a new instance of class (to which I added some methods and  
> variables), which in turn uses some of the added methods and  
> instance variables through getters/setters without any errors.
> Is there any trick to make these added methods and instance  
> variables visible ?
> Again, the new methods are correctly integrated into the  
> MethodDictionary with selectors and CompiledMethods according to  
> "aClass inspect".
> Is there another way to check whether the new methods and new  
> instance are really integrated into a new class?
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

More information about the Beginners mailing list