[Xotcl] Expand init arguments and custom destructor

Krzysztof Frukacz frukacz.krzysztof at gmail.com
Tue Feb 8 09:20:01 CET 2011


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


More information about the Xotcl mailing list