[Xotcl] "tie" command

Kristoffer Lawson setok at fishpool.com
Fri Jan 24 04:32:40 CET 2003


Been thinking if this would make sense:

while {$stuff} {
  tie myVar [MyClass new]
  ...
}

And the instance created from MyClass would be automagically collected on
each iteration. Ie. [tie] would tie an object to a variable: when the
variable's value is changed, or when the variable is destroyed, the object
is too -- or at least the refcount decreased. I often have Message objects
which are used once (after some data is read from somewhere) and then
destroyed. Quite often I forget the latter part ;-)

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





More information about the Xotcl mailing list