This is rather an unexpected behavior than a bug ... I think it would be ok, to force a full name for serialize and deepSerialize, that is, change the method in Serializer.xotcl to:
Serializer instproc serialize {objectOrClass} { my [my category $objectOrClass]-serialize [$objectOrClass] }
can you please check whether that would work in your example?
--uwe
On Tuesday 16 September 2003 22:34, MichaelL@frogware.com wrote:
Since you're getting 1.1 ready...
I ran across a very, very subtle bug. I was using the serializer to serialize an obj tree. The topological sorting wasn't quite working for one case. In the end, I tracked it down to the fact that I was passing in an unqualified name. The sorting routine was in turn using fully qualified references as it tried to build the correct ordering, and the mismatch meant that it got some orderings for the root object slightly wrong. (Basically a few objects were being created before their containers; their containers were objects aggregated by the root object.)
In effect, I was using this:
Serializer deepSerialize obj
when I should have been using this:
Serializer deepSerialize ::obj
I don't think you'd be able to reproduce this easily, because it turned out to relate to a specific set of objects and relationships. It turns out that for other reasons, even when you make this "mistake" the algorithm nearly works.
To make this work you'd either have to a) require fully qualified names or b) turn a name into a fully qualified name. I don't know enough about Tcl internals to say that (b) is a realistic option--but on the face of it it doesn't seem like it would be.
Don't know if this helps much. :-)