In the online reference manual, the volatile method is documented under Class, meaning it would be a class procedure. However the way it is demonstrated is:
Object new -volatile
Which would mean the object's [volatile] method is called. If [volatile] was actually a class procedure, then the object instance would not see it. In fact, it makes little sense that it would be a class procedure instead of one that can be applied to any object. Or have I missed something here?
In a similar vein, can [volatile] be called at any point, not just during object instantiation? I might be getting an object returned from somewhere else and, in that proc, I may want to make it volatile so as to not have to worry about the point of destruction.
Kristoffer Lawson schrieb:
In the online reference manual, the volatile method is documented under Class, meaning it would be a class procedure.
Kristoffer, you right this is a documentation bug
In a similar vein, can [volatile] be called at any point, not just during object instantiation? I might be getting an object returned from somewhere else and, in that proc, I may want to make it volatile so as to not have to worry about the point of destruction.
right. volatile is an ordinary method, causing the object to be destroyed, when the current variable context is left. The following script ...
--------------------------------------------------------- Class C -instproc destroy {} {puts "destroying [self]"; next} C c1
proc f {} { c1 volatile }
puts ==== f puts ==== ---------------------------------------------------------
... outputs:
==== destroying ::c1 ====
-gustaf
/ http://www.fishpool.com/~setok/
Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl