No registered users in community xowiki
in last 10 minutes
in last 10 minutes
[Xotcl] Expand init arguments and custom destructor
From: Krzysztof Frukacz <frukacz.krzysztof_at_gmail.com>
Date: Tue, 08 Feb 2011 09:20:01 +0100
Hello,
Thank for all your help so far. I have two more questions:
1. Is it less efficient if I expand a list before providing it as an
argument for init?
set myList [list 1 2 3 4]
MyClass myObject $myList
vs
eval MyClass myObject $myList
2. When do I need to create a custom destructor? I create objects inside
init - do I have to do that in this case, or will those object be
destroyed automatically when I destroy their parent?
MyClass instproc init args {
my contains {
MySecondClass innerObject
}
}
Best Regards,
Krzysztof
Date: Tue, 08 Feb 2011 09:20:01 +0100
Hello,
Thank for all your help so far. I have two more questions:
1. Is it less efficient if I expand a list before providing it as an
argument for init?
set myList [list 1 2 3 4]
MyClass myObject $myList
vs
eval MyClass myObject $myList
2. When do I need to create a custom destructor? I create objects inside
init - do I have to do that in this case, or will those object be
destroyed automatically when I destroy their parent?
MyClass instproc init args {
my contains {
MySecondClass innerObject
}
}
Best Regards,
Krzysztof