Creating an Array: Difference between revisions

Content added Content deleted
m (→‎Tcl: fix lang tag)
Line 907: Line 907:


lrepeat can be used to create multidimensional lists
lrepeat can be used to create multidimensional lists
<lang tcl>set a [lrepeat 4 [lrepeat 2 0]] ;# {{0 0} {0 0} {0 0} {0 0}}
<lang tcl>set a [lrepeat 4 [lrepeat 2 0]] ;# {{0 0} {0 0} {0 0} {0 0}}</lang>


Tcl does have an "<tt>array</tt>", though, which is really an "associative array":
Tcl does have an "<tt>array</tt>", though, which is really an "associative array":