[Cuis-dev] Class renaming

Juan Vuletich juan at cuis.st
Mon May 6 12:30:18 PDT 2024


Hi Luciano,

On 5/4/2024 8:55 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> Namespaces? ;)
> Interesting, why it was the not possible to do this before? What were 
> the main obstructions?

The first big thing here is that class references in all code are fixed. 
This is possible by RenameClass, part of Hernán Refactoring 
implementation for Cuis.

Still, see that we are renaming _all_ classes. Until recently, it worked 
for many but could fail because:
- Class references in backticked code were not found. The fix was, for 
instance, to make references to Color include #blue, that only 
references the class in backticked code.
- DateAndTime >> #is: is used during the rename, when fixing methods. 
Its own use of #DateAndTime is different before / after being itself 
updated.
- 'ProtoObject' and #Array were hardcoded literals. Now the class is 
asked for #name.

After fixes to these issues, all classes in the system can be renamed.

Cheers,

>
> On Sat, May 4, 2024 at 03:11 Juan Vuletich via Cuis-dev 
> <cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>> wrote:
>
>     Hi Folks,
>
>     For some experiments I've been involved with I wanted to be able to
>     rename _any_ class in Cuis. The result was a series of updates and
>     new
>     images I pushed today to GitHub.
>
>     So, you can have some fun by pulling the latest, and evaluating:
>
>     Smalltalk allClassesDo: [ :cls |(RenameClass from: cls to:
>     ('Cuis', cls
>     name) asSymbol) apply ]
>
>     After a couple of minutes, browse the system, and be surprised
>     that this
>     is even possible!
>
>     Cheers,
>
>     -- 
>     Juan Vuletich
>     www.cuis-smalltalk.org <http://www.cuis-smalltalk.org>
>     https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
>     https://github.com/jvuletich
>     https://www.linkedin.com/in/juan-vuletich-75611b3
>     https://independent.academia.edu/JuanVuletich
>     https://www.researchgate.net/profile/Juan-Vuletich
>     https://patents.justia.com/inventor/juan-manuel-vuletich
>     https://twitter.com/JuanVuletich
>
>     -- 
>     Cuis-dev mailing list
>     Cuis-dev at lists.cuis.st <mailto:Cuis-dev at lists.cuis.st>
>     https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240506/e3f74436/attachment.htm>


More information about the Cuis-dev mailing list