View · Search · Index
No registered users in community xowiki
in last 10 minutes

XOTcl/NX mailing list by object move?

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Mon, 20 Mar 2006 13:46:58 +0100

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