AW: [Xotcl] destroy invoked by object move?

Kristoffer Lawson setok at fishpool.com
Mon Mar 20 11:17:09 CET 2006


On 20 Mar 2006, at 12:10, Koen Danckaert wrote:

>> Snit has a "myvar" method that returns the fully qualified name of  
>> a snit member variable.  Perhaps something similiar (a method that  
>> returned a "reference" to an instance variable) would be useful in  
>> XOTcl?
>
> I use the following two global procs for that:
>
>    proc myproc {args} {linsert $args 0 [uplevel 1 self]}
>    proc myvar {var} {return [uplevel 1 self]::$var}
>
> The procs are global (not instprocs on "Object") because otherwise  
> I would have to write "my myvar" or "my myproc". Now I can simply  
> use them in the following way inside xotcl (inst)procs:

Aren't you forgetting the [requireNamespace] from the above code?

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



More information about the Xotcl mailing list