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

XOTcl/NX mailing list by object move?

From: Scott Gargash <scottg_at_atc.creative.com>
Date: Mon, 20 Mar 2006 18:54:38 -0700

xotcl-bounces_at_alice.wu-wien.ac.at wrote on 03/20/2006 12:29:57 PM:

>
> On 20 Mar 2006, at 18:13, Koen Danckaert wrote:
>
> >>>> I have added "::xotcl::mymethod" and "::xotcl::myvar" to my
> >>>> development version. i guess, you would you prefer to have
> >>>> these exported. Opinions?
> >>>
> >>> On giving it some thought I think I actually prefer the version
> >>> that would be part of Object. After all, it is that object's
> >>> variable that we want.

I also think it should be methods. An object owns its methods/variables, you should have to ask the
object for a reference. Just reach in from outside and grabbing a reference feels...rude.

Asking the object also gives it a chance to overload it. I can't imagine why, but an object might
want to know that something has a reference to its internal state.

> It's only really necessary for variables which are linked to other
> systems as for callbacks you can generally do f.ex.:
>
> after 100 [list [self] doStuff]
>
> which is what I actually do. I mean, presumably the problem with
> using a method by its direct namespace is also that filters get
> avoided, or? (at least I think it was that way at some point in
> XOTcl's history). That, to me, would mean it's not a good method
> except for very specific cases.

I would expect that [list [self] dostuff] is what [my &method doStuff] returns. Isn't that the
desired behavior to return a list that when evaluated acts as though you have invoked the method on
the object?

At least, that's what snit does with "mymethod". Although snit doesn't have nearly the same design
space as XOTcl, so maybe it's not comparable.

      Scott