----- Original Message ----- 
From: "Ryan King" <rking / panoptic.com>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Monday, August 19, 2002 1:40 PM
Subject: RenameMethod refactoring (Was: Re: IDE vs. editor)


> On 2002.08.20, Mauricio Fern?ndez <batsman.geo / yahoo.com> wrote:
> > [regarding a mechanical "RenameMethod" refactoring for ruby]:
> > I believe a parser wouldn't be enough:
> 
> Agreed: a simple parser wouldn't be enough.  "eval" is one of
> many examples where it's non-trivial to discover the correct type
> of a Ruby object from source.
> 
> The original Smalltalkers dealt with this problem in a simple
> way:  Just substitute textually, prompting the user with the list
> of effected lines.
> 
> To my knowledge, no one has ever written a more effective
> RenameMethod for a dynamically typed language.  Probably the
> 80/20 rule in effect.

Interesting thread.

Naive idea: Maybe add a hook into eval that will
warn about a failed refactoring before calling a
method. And/or modify method_missing.

Wow, couldn't that get hairy?

Probably the best way is to document the RenameMethod
by saying: This may fail if your code ever builds the
method name and calls it.

Hal