On Sun, Dec 18, 2011 at 12:05 AM, Yanni Chiu <yanni@rogers.com> wrote:
On 17/12/11 9:28 PM, Martin Dias wrote:

Well, so I guess we will change just the classes and traits, and
not every symbol.

I was in favor of renaming every symbol because the "class rename"
refactoring changes any method who mention the original name.

That's a reference to a class, by its global name, and it's the right thing to rename it when refactoring.

Now I'm not sure what is meant by "renaming every symbol". Is there some structure in a compiled method (which holds a class name symbol) which is going to be renamed? Or, are you talking about any serialized symbol, which happened to be the same as the class to be renamed, would be renamed? Or are both these scenarios the same?

For example, in the method

Object >>
arrayWithSomething
� � ^Array with: OldClass with: #OldClass�

if you inspect Object >> #arrayWithSomething, in the literals you will see:
- for the first array element, an association #OldClass->OldClass, which is an entry in Smalltalk globals. This association should be materialized as #NewClass->NewClass.
- for the second array element, the symbol�#OldClass. Here is my dubt: 1) materialize as�#NewSymbol�or 2) as�#OldSymbol?

1)�I think in this case we want to materialize the method as:

arrayWithSomething
� � ^Array with: NewClass with: #NewClass�

But...

2) suppose that in the same file we serialized some other object (not the above mentioned method) who points to the symbol #OldClass. Maybe we don't want to rename the symbol in this case.