Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TclOO: [variable] vs. [my variable]

75 views
Skip to first unread message

Will Duquette

unread,
Jun 19, 2013, 12:45:57 PM6/19/13
to
Suppose you want to reference an instance variable inside a TclOO method. You can do this:

method foo {} {
my variable counter
incr counter
}

But you can also do this, which seems to have the same effect:

method foo {} {
variable counter
incr counter
}

Both create a variable "counter" in the instance's namespace. Practically speaking, is there a difference?
0 new messages