On 2003.01.17, Peter M. Jansson <[EMAIL PROTECTED]> wrote:
> (...that work in AOLserver.)
[...]
> Things like a list of arrays weren't possible; if you wanted to have
> such a thing, you had to fake it.  [...] How do Tcl programmers
> normally do such things?

Generally, when I find myself needing things like, say, a list of
arrays, in Tcl, they tend to be design smells.  It's the "I can write
Perl in any language!" syndrome.

However, Tcl is really powerful and "faking it" isn't too bad.  If I
need a list of arrays, I'll just create a list of array references.
I'll just know that if I want access to the array, I'll have to
dereference to get there.

set a(1) foo
set b(1) bar
set array_list [list a b]

ns_adp_puts [set [set [lindex $array_list 0]]]

:-)

-- Dossy

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)

Reply via email to