<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>Re: [squeak-dev] Getting rid of Display global</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Isn't there a rewrite tool for Squeak?<BR>
<BR>
Cheers!<BR>
<BR>
-Boris (via BlackBerry)<BR>
<BR>
----- Original Message -----<BR>
From: squeak-dev-bounces@lists.squeakfoundation.org &lt;squeak-dev-bounces@lists.squeakfoundation.org&gt;<BR>
To: The general-purpose Squeak developers list &lt;squeak-dev@lists.squeakfoundation.org&gt;<BR>
Sent: Sat Nov 08 09:26:05 2008<BR>
Subject: [squeak-dev] Getting rid of Display global<BR>
<BR>
I'd like to ask, is there any ways to automatically replace all<BR>
references to some global ( Display, for instance) with message send<BR>
and recompile all modified methods accordingly.<BR>
In OB i saw some ways to manipulate with code on AST level, where it<BR>
can clearly tell that Display is global.<BR>
I tried to do a global text search &amp; replace , but its quite<BR>
inconvenient, because it still leaves a lot of manual work.<BR>
The most bigger issues with textual replace is, that if you replace<BR>
'Display' with 'self getDisplay' in 'DisplayScreen' , you will get<BR>
'self getDisplayScreen' :)<BR>
It is possible, of course to write a clever regex pattern to avoid<BR>
such situations, but again, what if i don't want to touch comments?<BR>
<BR>
Another thing is assignment - with AST on hand, it can clearly tell,<BR>
if you need to replace an assignment with setter message send, while<BR>
if you doing a textual replace you have to deal with it by writing<BR>
another regex.<BR>
<BR>
And finally, replacing using AST will guarantee that method will be<BR>
compiled under any circumstances.<BR>
<BR>
Can anyone tell me, or show some code snippets, how to do this using OB?<BR>
I found a lot of different refactoring features in OB, but can't find<BR>
an easy way to do what i need.<BR>
<BR>
--<BR>
Best regards,<BR>
Igor Stasenko AKA sig.<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>