On Tuesday 24 July 2018 04:44 AM, Ralph Boland wrote:
In squeak you can find out all references to a variable of a class by clicking on the vars button.
Is there a way to find only the references to a variable of a class that assigns a value to that variable?
Instance variables are also objects, as are classes. When inspecting an object, you can right click on self or any instance variable and select "methods storing into this inst var".
HTH .. Subbu
Thanks Subbu (and others for their comments).
Based on this advice I went exploring the debugger to figure out what code was executed when this menu selection was made. I eventually figured out that when the method <browseVariableAssignments> (implemented by several classes) is invoked a list of variables is presented to the user to choose from and for the selected variable a list of methods assigning to that variable is presented. i.e. what I wanted.
Among the senders of this method are the debugger, inspector, and browsers. To send this method bring up the (correct) menu in, for example a browser, and select: 'assignments... (a)'.
Going forward this knowledge will be a great help.
Might be nice if right clicking on the 'Vars' button also did this but I have 99.9 percent of what I wanted to I'm happy.
Ralph
beginners@lists.squeakfoundation.org