AW: [Xotcl] destroy invoked by object move?

Gustaf Neumann neumann at wu-wien.ac.at
Mon Mar 20 13:46:58 CET 2006


Koen Danckaert schrieb:

> Gustaf Neumann wrote:
>
>>>
>>>    proc myproc {args} {linsert $args 0 [uplevel 1 self]}
>>>    proc myvar {var} {return [uplevel 1 self]::$var}
>>
>>
>> as kristoffer noted (and as in my earlier version shows)
>> it makes sense to add a requireNamespace to myvar.
>
>
> I usually put the requireNamespace in the "init" method (when it's 
> needed).

Same with me ...

> But I agree that the overhead of putting it in myvar would be negligible.

the point is to make things more robust to beginners...

> I used myproc because the name "method" isn't used anywhere in XOTcl.  

well we have at least "info methods";
i am trying to use the following terminology:
we have object specific methods
  - proc
  - forward
  - cmd
and class defined methods
  - instproc
  - instforward
  - instcmd (e.g "create" of Class, or "destroy" of Object).
when we call one of these, we have method invocations.
If we do not distinguish between these variants, "method" seems
the right term. "mymethod" is a little bit longer and not so crisp
as "myproc".

I have added "::xotcl::mymethod" and "::xotcl::myvar" to my
development version. i guess, you would you prefer to have
these exported. Opinions?

-gustaf neumann





More information about the Xotcl mailing list