In January of 2004, a poster to comp.lang.tcl asked which of the [object oriented] [tcl] [extension]s allowed one to define class members which were other objects. Several people submitted answers - and some of the answers provided demonstrated how the different extensions might do just that. Here's some of the examples provided: ---- [Snit] snit::type C2 { variable this variable that constructor {args} { set this [C2 %AUTO%] set that [C2 %AUTO%] } destructor { catch {$this destroy} catch {$that destroy} } method doThis {} { $this doSomething } method doThat {} { $that doSomething } } [incr Tcl] itcl::class C1 { } itcl::class C2 { variable m1 variable m2 constructor {} { set m1 [C1 #auto] set m2 [C1 #auto] } destructor { itcl::delete object $m1 $m2 } } [stooop] class C2 { proc C2 {this} { set ($this,o1) [new C1] set ($this,o2) [new C1] } proc ~C2 {this} { delete $($this,o1) $($this,o2) } class C1 { proc C1 {this} {} proc ~C1 {this} {} } } delete [new C2] ---- [Category Object Orientation] | [Category Example]