Re: Referencing values in an array
- From: stefan <stefan.sobernig@xxxxxxxxxxxxx>
- Date: Tue, 29 Jul 2008 06:08:17 -0700 (PDT)
That looks good. I wasn't sure if and how to use -multivalued but your
example really helps!
good to hear ...
set shape [::MyShape new -position $i]
What does the "::" mean? When is it used? I've allready seen it a couple
of times.
Well, this is more related to Tcl than XOTcl; i.e. the name resolution
mechanism. You may
always give _relative_ names which will then be resolved against the
current (namespace) and, if the first fails,
the global namespace (::). By using explicit/absolute names
(::<somenamespace>::<command>) you engage
in fail-safe programming (rougly speaking) ... note that XOTcl name-
related instructions (::xotcl::Class->new(), self, ...) always
return absolutely named object identifiers that can be passed around
once assigned to variables ...
In the above snippet, you may also write ...
set shape [MyShape new -position $i]
absolute naming only turns relevant in environments that you cannot
control in its entirety, i.e.
a name/scope conflicts are probable ...
//s
.
- Follow-Ups:
- Re: Referencing values in an array
- From: Daniel Kirsch
- Re: Referencing values in an array
- References:
- [XOTcl] Referencing values in an array
- From: Daniel Kirsch
- Re: [XOTcl] Referencing values in an array
- From: Daniel Kirsch
- Re: Referencing values in an array
- From: stefan
- Re: Referencing values in an array
- From: Daniel Kirsch
- Re: Referencing values in an array
- From: stefan
- Re: Referencing values in an array
- From: Daniel Kirsch
- [XOTcl] Referencing values in an array
- Prev by Date: Re: Referencing values in an array
- Next by Date: Re: expect match fancy prompt
- Previous by thread: Re: Referencing values in an array
- Next by thread: Re: Referencing values in an array
- Index(es):