On Mon, Aug 19, 2002 at 11:28:28PM +0900, bbense+comp.lang.ruby.Aug.19.02 / telemark.stanford.edu wrote:
> - - You've got me there. I was extrapolating my C refactoring
>   experience, there tags-query-replace rules. However, I can
>   see the problems with doing that in ruby. It would depend
>   on how smart the tag program was, I suspect you'd have to
>   have a full blown ruby parser to fully support this kind
>   of refactoring. But since we have one handy, I don't think
>   it would be impossible. 

I believe a parser wouldn't be enough:

	a = create_some_object()
	a.instance  # 2 b renamed? depends on a.type

Sure, a really clever tool would analyze create_some_object() and infer
the type, but this is guaranteed not to work always (eval, etc...) and
will fail a lot if the program isn't so intelligent.

The only way I can think of that could possibly work is interpreting
and keeping track of the method calls (plus their position in the
source code). But we'd have to test all code branches, which might be
impossible...

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
  
Windows without the X is like making love without a partner.
	-- MaDsen Wikholm, mwikholm / at8.abo.fi