Global initialization for new inst vars

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

Global initialization for new inst vars

Sean P. DeNigris
Administrator
From https://pharo.fogbugz.com/f/cases/10856/Global-initialization-for-new-inst-vars :
When adding an instance variable which should be given a default value e.g. in #initialize, you have a problem if there are existing instances of the class. Instead of the proper default, they will have a nil value. Also (although less importantly), you have to stop what you're doing to add the statement to #initialize.
In the mean time, I started implementing it in Pharo 2.0 and ran into a little issue...

If you:
1. Load the changeset from the issue
2. Debug a method e.g. "RBAbstractCondition new doSomething"
3. Type the name of a non-existence inst var and accept
4. In the dialog, type 4, and accept the dialog

The source will appear to have been accepted, but if you browse the method, the statement with the inst var name was not added.

n.b. it works fine when editing in a browser instead of the debugger
Cheers,
Sean