f



Find methods which refer to string, symbol, or method

I'm digging around in the image to try and figure this out but haven't
find the correct method invocation yet and I'm hoping someone might be
able to help shortcut this process.  What I'm trying to do is to find
all methods (either within the entire system or, preferably, just
within a single class) which refer to a given string, symbol, or
method.  I've found the #references family of methods in
SmalltalkSystem but have not had luck figuring out how to get them to
give back something resembling what I want.

Any/all help appreciated.

Thanks,
Bob
0
jarvis (3)
12/11/2009 12:46:18 AM
comp.lang.smalltalk.dolphin 3769 articles. 0 followers. Post Follow

2 Replies
439 Views

Similar Articles

[PageSpeed] 27

On 12/10/2009 7:46 PM, Bob Jarvis wrote:
> I'm digging around in the image to try and figure this out but haven't
> find the correct method invocation yet and I'm hoping someone might be
> able to help shortcut this process.  What I'm trying to do is to find
> all methods (either within the entire system or, preferably, just
> within a single class) which refer to a given string, symbol, or
> method.  I've found the #references family of methods in
> SmalltalkSystem but have not had luck figuring out how to get them to
> give back something resembling what I want.
....

Perhaps this work for what you need:

"This should handle symbols and methods."
Collection whichMethodsReferTo: #do:

"This will work for strings."
Collection whichMethodsContainSource: 'first'

I suspect that there may be a lot of different ways to do this.

Chris
0
Christopher
12/11/2009 5:16:22 AM
On Dec 11, 12:16=A0am, "Christopher J. Demers"
<cdemersn...@mitchellscientific.com> wrote:
> Perhaps this work for what you need:
>
> Chris

Sorry I didn't respond earlier.  Thanks for the suggestions.  If you
pull down a new copy of my Burning River Goodies and look in the
RuleBasedLogic package you'll see how I ended up solving the problem.

In short, what I've got is a BlockClosure and I needed to determine if
it referred to a method or string.  As it turned out I could use
BlockClosure>>method to find my way back to the method which defined
the block, then use the method's #refersToLiteral: and #sendsSelector:
methods to figure out if the method or literal was used in the
defining method.

Thanks,
Bob
0
Bob
12/28/2009 3:08:44 AM
Reply: