[squeak-dev] Getting rid of Display global

Boris Popov boris at deepcovelabs.com
Sat Nov 8 19:28:15 UTC 2008


Isn't there a rewrite tool for Squeak?

Cheers!

-Boris (via BlackBerry)

----- Original Message -----
From: squeak-dev-bounces at lists.squeakfoundation.org <squeak-dev-bounces at lists.squeakfoundation.org>
To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org>
Sent: Sat Nov 08 09:26:05 2008
Subject: [squeak-dev] Getting rid of Display global

I'd like to ask, is there any ways to automatically replace all
references to some global ( Display, for instance) with message send
and recompile all modified methods accordingly.
In OB i saw some ways to manipulate with code on AST level, where it
can clearly tell that Display is global.
I tried to do a global text search & replace , but its quite
inconvenient, because it still leaves a lot of manual work.
The most bigger issues with textual replace is, that if you replace
'Display' with 'self getDisplay' in 'DisplayScreen' , you will get
'self getDisplayScreen' :)
It is possible, of course to write a clever regex pattern to avoid
such situations, but again, what if i don't want to touch comments?

Another thing is assignment - with AST on hand, it can clearly tell,
if you need to replace an assignment with setter message send, while
if you doing a textual replace you have to deal with it by writing
another regex.

And finally, replacing using AST will guarantee that method will be
compiled under any circumstances.

Can anyone tell me, or show some code snippets, how to do this using OB?
I found a lot of different refactoring features in OB, but can't find
an easy way to do what i need.

-- 
Best regards,
Igor Stasenko AKA sig.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20081108/e67bac86/attachment.htm


More information about the Squeak-dev mailing list