from wiki: (http://wiki.tcl.tk/3262) and newsgroups.
Tcl does not provide a way to simply pass arrays by value, as this is usually done for strings. Straigh forward way to go around this problem is to convert an array to list and pass it as list. Another method is to use upvar to pass variable by name. Some other methods are mentioned below:
- Use dict command instead of array (for Tcl 8.5 or greater)
- Use extensions:
- Tclx keyed lists.
- the structure command from the megapkg structure extension.
- ...