AW: [Xotcl] destroy invoked by object move?
Scott Gargash
scottg at atc.creative.com
Fri Mar 17 23:13:01 CET 2006
xotcl-bounces at alice.wu-wien.ac.at wrote on 03/17/2006 08:25:37 AM:
>
>
> A double-reference would solve this. In that way the handle returned
> by [new] and [self] would always be a valid command for the object,
> throughout its whole lifetime. If it is moved to be a child of
> another object the handle remains the same (or at least can be used),
> but the ownership is changed. Whether this is workable in XOTcl or
> not is, of course, something you would be better at deciding.
I've been thinking along somewhat different lines, the classic "extra level of indirection" that
solves all problems. What about using interpreter aliases as an indirection? What would happen if
all objects were created as anonymous commands inside (say) the xotcl namespace, and the object name
was just an alias to the anonymous object?
This would let move be straightforward, drop the old alias and create a new one. From what I've
inferred of xotcl's implementation, I think xotcl would be (mostly) unaffected by the change. The
one thing that I think might be busted would be is parent/child relationships. Rather than
introspecting into the commands, you'd have to introspect the aliases (relationships would be
inferred by alias location instead of command location). That might be difficult, Tcl aliases are
surprisingly hard to introspect.
I also don't know what the performance implications would be (I think an alias introduces some
overhead). But if objects didn't ever move, there might be some potential optimizations available
too.
Just a thought...
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://alice.wu-wien.ac.at/pipermail/xotcl/attachments/20060317/5621130c/attachment.html
More information about the Xotcl
mailing list