Thanks Mat,

Like C++, isn't the instance of bbb temporaly created at
constructor of aaa, then destroyed after the construction?

No. Curl is a garbage-collected language, like Java and C#. Objects are only freed when there are no more pointers to them anywhere.

Garbage collection loops through all the objects that have been
allocated, finds the ones that are not "reachable" any more, and frees
them automatically.

You do not need to call garbage-collect yourself; the system will
automatically call it for you when it needs more memory.


I know it is really right what you said. But I wonder that what I can't really understand doesn't that. maybe my example and description were not good enough, I guess.

In my previous mail, what I want to said was :

1.at first, at this point,

let a:aaa = { aaa {bbb} }
{garbage-collect}

with using {garbage-collect},
I thought I had removed the instance of class bbb.

2. then a window was shown at {a.wnd.show}
and I expected that something like clash would happen
if I pushed the button on the window because;

A)the instance of class bbb had gone away at step 1

B)about difinition of constructor,

  {constructor public {default b:bbb}
    set self.fnc = { proc {}:bool {return {b.def}} }
    set self.btn = {CommandButton
                       {on Action at b:CommandButton do
                           set b.label = {String {self.fnc}}
                       }
                   }
    {self.box.add self.btn}
    {self.wnd.add self.box}
  }

if 'self.fnc' was evaluated, then Curl would evaluate this part too;

{ proc {}:bool {return {b.def}} }
                ^^^^^^^^^^^^^^
and (I thought that) the "b" didn't exist anymore at that time,
and could not work at all.

but, as you know, the code actually works.
And I can not understand why.

Can you give more any advice or hint?
And I'm sorry if you're bored to such begginer's quetion many time.
I'm asking my boss to go semmner of Curl.inc now....

Regards.

--
-----
Maekawa Takanobu
e-mail:[EMAIL PROTECTED]
CANSOFT,INC.Tel:044(969)9747 Fax:044(969)9748
http://www.cansoft.co.jp/

*******************************************
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]



Reply via email to