[Xotcl] Re: [Xotcl] Re: [Xotcl] Probable bug: no method calls with "next" & init

Gustaf Neumann Gustaf.Neumann@wu-wien.ac.at
Mon, 5 Feb 2001 22:55:57 +0100 (CET)


>>>>> "KL" == Kristoffer Lawson <setok@fishpool.com> writes:
KL> On Mon, 5 Feb 2001, Gustaf Neumann wrote:
>> Somehow, i have the feeling, that Kristoffer intended a class to the
>> method "whatever". Why not use:                    
>> 
>> Class Bar -superclass Foo
>> Bar instproc init {} {
>> next myArg
>> [self] whatever niceSystem
>> }

KL> Because the "whatever" method should be called along with the object
KL> creation -- and specifically before it takes place. Just as if I had
KL> created an object of the superclass with -whatever in the init line.


 The "-methods" are not executed by init, but by create .  The Class
 allocs the objects, obtains default values, calls the "-methods" and
 finally calls init (if it was not triggered by -init in the "-methods").

 If you say that the execution of "whatever" should happen before
 init,  and you want to magically add "-methods", i would recommend to 
 refine the create method....

 -gustaf