[Xotcl] xo beginner

Mads Linden ml at electronicfarm.com
Sat Jun 25 12:00:22 CEST 2005


Thanks

I guess I just have to get my head around things like that, a bit dangerous
I feel to call methods before contruct.

It would be ok if it was "procs" that worked like that insode the classs,
but not instprocs :(

Mads

-----Original Message-----
From: Kristoffer Lawson [mailto:setok at fishpool.com]
Sent: 25 June 2005 11:49
To: Mads Linden
Subject: Re: [Xotcl] xo beginner


On 25 Jun 2005, at 04:08, Mads Linden wrote:


> i am trying to learn XO....... so be nice :)
>

Hi, always nice to see that interest in XOTcl is growing (from a user's
point of view).


> #####
>
> Class Project
>
> Project instproc init {} {
>     puts "INIT"
> }
>
> Project instproc getarg {value} {
>     puts "getarg : $value"
> }
>
>
> Project .p -getarg 1
>
> #####
>
> Since xotcl allow method call in the same line as the creation of the 
> instance I offcourse tried that out ==
>
> This gives me
>
>
>
>>> getarg : 1
>>> INIT
>>>
>>>
>
> I expected it to call the constructor (init) before method.
>

Actually the -dash methods are called first. There was actually a reason for
this, but I cannot quite remember what it was. Something to do with wanting
to initialise things before the actual init method. If you want to be sure
to call init first do:

Project .p -init -getarg 1

            /  http://www.fishpool.com/~setok/




More information about the Xotcl mailing list