About KCP and automatic initialize

ducasse ducasse at iam.unibe.ch
Tue Sep 9 18:51:44 UTC 2003


This is cool. I like the idea.

Stef

On Mardi, sep 9, 2003, at 18:41 Europe/Zurich, Torge Husfeldt wrote:

> Hi,
> On Tue, 9 Sep 2003 11:25:05 +0000 (UTC), Lukas Renggli 
> <renggli at hotmail.com> wrote:
>
>>> So we would like to know what other people think about that. Please 
>>> think that we ***really*** pay attention of Squeak and that this is 
>>> not  "another stuff of these researchers" because we have much more 
>>> exciting  stuff that will never go in Squeak. This is just to catch 
>>> up with the  mistakes of the past.
>>
>> I like the idea to get that included into the base image!
>>
>> Browsing trough some images of recent Squeak (and VW) projects showed 
>> that I've added the messages #new and #initialize to about all my 
>> classes that are direct subclasses of Object.
>>
>> I don't see a reason why not to re-factor this, remove that ugly 
>> duplicated code and that source for bugs: I do remember several times 
>> when I accidentally wrote 'self new' instead of 'super new' or when I 
>> misspelled the message-name #initialize.
>>
>> 	new
>> 		^super new
>> 			initialize;
>> 			yourself
>>
>> 	initialize
>>
>> I hope that this is the last time, I've ever written those lines ;)
>>
>> Lukas
>>
> Here is the sUnit test that comes along with the above change,
> preventing anybody from accidentally implementing super new initialize 
> again.
>
> HTH,
> Torge
>
>
> -- 
> Der Mensch kann wohl tun, was er will, aber er kann nicht wollen, was 
> er will.
> (Schopenhauer)<InitializationTest-th.2.cs>



More information about the Squeak-dev mailing list