About KCP and automatic initialize

Torge Husfeldt torge.husfeldt at gmx.de
Tue Sep 9 16:41:20 UTC 2003


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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InitializationTest-th.2.cs
Type: application/octet-stream
Size: 1367 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030909/a348efb1/InitializationTest-th.2.obj


More information about the Squeak-dev mailing list