|
Boost : |
From: Chris Lattner (clattner_at_[hidden])
Date: 2007-09-03 12:48:02
On Sep 3, 2007, at 4:47 AM, Andrew Sutton wrote:
>> Hmm, I wouldn't consider renaming a function a simple
>> transformation, really.
>> Consider overloading. You have to do full overload resolution (one
>> of the
>> most complex things in C++) in order to figure out whether a name
>> in a
>> given function call needs to be changed or not.
>
> Renaming the function is simple. Ensuring that you're avoiding name
> conflicts can be more difficult. Propagating the change requires a
> lot more work. It's also requires knowledge beyond what a compiler
> can give you since changes may be required in multiple translation
> units.
The standard definitions of Refactoring typically does include
verifying and ensuring that renames a) properly obey scope and other
language rules and b) don't conflict with other names in any other
scope. Refactoring does require processing multiple translation
units in most cases, I'm not sure why you'd assume it doesn't.
Note specifically that 'sed' does not qualify as a refactoring tool -
you have to do a lot more semantic analysis of the program to do
refactoring safely.
-Chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk