Hi
Thanks for good resource tip to Kristoffer Lawson. There are good publication at http://ftp.sage.usenix.org/events/tcl2k/duffin.html
The Feather tcl extension seems to be very interesting. It is shame it was published only as Windows binary (Kann ein Mensch so tief sinken?)
I have made first attempt to implement it and I have noticed one big Problem. source as Xotcl extension http://www.xdobry.de/xotclref.tar.gz (copy in xotcl/src and make -f XRMakefile)
example
Class A set a [A newReference] $a set var value
by last line the tcl interpreter try to convert my new type to Tcl_ObjType tclCmdNameType by this operation the internal representation is freed. And so the object is deleted before I can use it as command
There can be 2 solution on this problem
1. Special invoke of referenced objects invokeRef $a set var value it is probably also used by Feather extension.
2. Overwrite the interal pointers of Tcl_ObjType tclCmdNameType SetCmdNameFromAny see tcl sources generic/tclExecute.c it should not freed our new Tcl_ObjType XOTclReferenceObjectType
So I give up. These two solution does not seems to be acceptable. Maybe futures version of tcl interpeters will offer more flexible type conversion solution. The new type should decide by itself how it can be converted to another type.
=========================================
Artur Trzewik http://www.xdobry.de
=========================================
On Tue, 22 May 2001, Artur Trzewik wrote:
So I give up. These two solution does not seems to be acceptable. Maybe futures version of tcl interpeters will offer more flexible type conversion solution. The new type should decide by itself how it can be converted to another type.
I suggest posting to comp.lang.tcl. They tend to be pretty helpful there and as Jeff Hobbs reads it, you might get a solution you overlooked. At the very least, you can suggest those fixes to Tcl. Who knows, maybe something will arrive for 8.4 ;-)
- ---------- = = ---------//--+ | / Kristoffer Lawson | www.fishpool.fi|.com +-> | setok@fishpool.com | - - --+------ |-- Fishpool Creations Ltd - / | +-------- = - - - = --------- /~setok/
For using garbage collection with handles, also check TclJava. It does exactly that and only releases the object for it to be collected by Java when no more references are found to the handle (a string). Apparently this works, to some extent. Here's a brief description and an explanation of one of the problems that Feather would actually have solved:
http://tcl.activestate.com/man/java1.2.6/TclJava/JavaGC.html
- ---------- = = ---------//--+ | / Kristoffer Lawson | www.fishpool.fi|.com +-> | setok@fishpool.com | - - --+------ |-- Fishpool Creations Ltd - / | +-------- = - - - = --------- /~setok/