[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.
^^^^^^^^^^^^^^^^
It’s IMHO the only affordable way to do it: having method_missing check
if a method of the corresponding class has been renamed, call it by its
new name and annotate the place in the source code where this happened.
···
On Tue, Aug 20, 2002 at 03:45:47AM +0900, Hal E. Fulton wrote:
Naive idea: Maybe add a hook into eval that will
warn about a failed refactoring before calling a
method. And/or modify method_missing.
–
_ _