[squeak-dev] using reflections in squeak

tim Rowledge tim at rowledge.org
Sun Apr 28 23:46:33 UTC 2013


On 28-04-2013, at 1:55 PM, Dvir Faivel <sdvirf at t2.technion.ac.il> wrote:

> hi there,
> i have a question about squeak object model.
> 
> how can i check whether a method contains a certain piece of code?

You'll get better advice if you expand upon what you want & why; what is the real problem you are trying to solve here?

If, for example you're simply wanting to programatically find all senders of a particular message then the code is already there -
take a look at SystemNavigation>allCallsOn:fromBehaviors:sorted: to see how to scan all the methods implemented by a list of behaviours (ie classes or metaclasses) for sends of a particular message, including ones that are special cases.
If you already know which class and method you want to look at then examine Behavior>whichSelectorsReferTo:specialByte:thorough: to see how the system does it.

Or are you wanting to look for particular fragments of code with some sort of text based pattern matching? Or…?


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
ASCII to  ASCII, DOS to DOS.




More information about the Squeak-dev mailing list