About KCP and automatic initialize

Noury Bouraqadi bouraqadi at ensm-douai.fr
Wed Sep 10 08:14:17 UTC 2003


Hi,

Please note that I introduce the new/initialize for both new and new: 
(see 
http://minnow.cc.gatech.edu/squeak/uploads/KCP-0102-GeneralizeTheUseOfTheNewInitializePattern.cs). 
When doing this, I of course worte the corresponding tests that check 
the unicity of both the new and new: methods that perform initialisation 
(see
http://minnow.cc.gatech.edu/squeak/uploads/KCP-0102-t-GeneralizeTheUseOfTheNewInitializePattern.cs).

Noury

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
>
>
>------------------------------------------------------------------------
>
>
>  
>

-- 
------------------------------------------
Dr. Noury Bouraqadi - Enseignant/Chercheur
Ecole des Mines de Douai - Dept. G.I.P
http://csl.ensm-douai.fr/noury

European Smalltalk Users Group
http://www.esug.org 

Squeak: an Open Source Smalltalk
http://www.squeak.org 
------------------------------------------





More information about the Squeak-dev mailing list