replacing SmalltalkImage current

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

replacing SmalltalkImage current

Nicolas Cellier
I join an update of the small utility to find message sent to globals.

This utility can be used like this:

1) create a file out of all senders of (SmalltalkImage current xxx).
MessageSentToGlobalMessage fileoutMessagesSentTo: #SmalltalkImage
selector: #current.

2) replace (SmalltalkIlage current) by Smalltalk in a text editor
(FileList is perfect).

3) fileIn from FileList et voila

You get unchanged formatting and unchanged Timestamping.

Nothing urgent though.
a) it maked changes not compatible with Pharo (maybe temporarily
because Pharo is interested in this refactoring)
b) we can also add an indirection via Smalltalk commandLine, Smalltalk
os, Smalltalk vm...
As we already have Smalltalk globals... why not ?

Nicolas



Utility.st (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: replacing SmalltalkImage current

Colin Putney

On 2010-03-06, at 5:15 PM, Nicolas Cellier wrote:

> I join an update of the small utility to find message sent to globals.
>
> This utility can be used like this:
>
> 1) create a file out of all senders of (SmalltalkImage current xxx).
> MessageSentToGlobalMessage fileoutMessagesSentTo: #SmalltalkImage
> selector: #current.
>
> 2) replace (SmalltalkIlage current) by Smalltalk in a text editor
> (FileList is perfect).
>
> 3) fileIn from FileList et voila
>
> You get unchanged formatting and unchanged Timestamping.

Um, don't we want to change the timestamps? It's a new version of the method after all.

Why not use the rewrite tool?

Colin
Reply | Threaded
Open this post in threaded view
|

Re: replacing SmalltalkImage current

David T. Lewis
On Sat, Mar 06, 2010 at 07:14:22PM -0800, Colin Putney wrote:

>
> On 2010-03-06, at 5:15 PM, Nicolas Cellier wrote:
>
> > I join an update of the small utility to find message sent to globals.
> >
> > This utility can be used like this:
> >
> > 1) create a file out of all senders of (SmalltalkImage current xxx).
> > MessageSentToGlobalMessage fileoutMessagesSentTo: #SmalltalkImage
> > selector: #current.
> >
> > 2) replace (SmalltalkIlage current) by Smalltalk in a text editor
> > (FileList is perfect).
> >
> > 3) fileIn from FileList et voila
> >
> > You get unchanged formatting and unchanged Timestamping.
>
> Um, don't we want to change the timestamps? It's a new version of the method after all.

Well, it's a judgement call, but in this case I think it makes sense
not to change the time stamps. The timestamps and intials give some
clues to help the reader understand who wrote something and when, and
it is good to preserve these clues when no functional change has been
made to the method.

The FixUnderscores procedure for changing assignment operators
to ":=" is another example where this makes sense.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: replacing SmalltalkImage current

Nicolas Cellier
In reply to this post by Colin Putney
2010/3/7 Colin Putney <[hidden email]>:

>
> On 2010-03-06, at 5:15 PM, Nicolas Cellier wrote:
>
>> I join an update of the small utility to find message sent to globals.
>>
>> This utility can be used like this:
>>
>> 1) create a file out of all senders of (SmalltalkImage current xxx).
>> MessageSentToGlobalMessage fileoutMessagesSentTo: #SmalltalkImage
>> selector: #current.
>>
>> 2) replace (SmalltalkIlage current) by Smalltalk in a text editor
>> (FileList is perfect).
>>
>> 3) fileIn from FileList et voila
>>
>> You get unchanged formatting and unchanged Timestamping.
>
> Um, don't we want to change the timestamps? It's a new version of the method after all.
>
> Why not use the rewrite tool?
>
> Colin
>

Because I don't know the rewrite tool.
Is there a way to avoid auto-formatting of rewriten methods ?

Nicolas