Re: Referencing values in an array



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
.