Array concatenation: Difference between revisions
Content added Content deleted
(Add LIL) |
|||
Line 1,924: | Line 1,924: | ||
print array3(i) |
print array3(i) |
||
next</lang> |
next</lang> |
||
=={{header|LIL}}== |
|||
LIL uses lists instead of arrays. The builtin '''append''' command could be used as '''append a $b''', but that would add the entire list in variable '''b''' as one item of variable '''a'''. The '''foreach''' flattens the items of b for appended to a. The '''concat'' builtin would end up smushing together the last item of a with the first item of b. |
|||
<lang tcl>## |
|||
Array concatenation in LIL |
|||
## |
|||
set a [list 1 2 3] |
|||
set b [list 4 5 6] |
|||
foreach i $b {append a $i} |
|||
print $a |
|||
print [index $a 3]</lang> |
|||
=={{header|Limbo}}== |
=={{header|Limbo}}== |
||
<lang limbo>implement Command; |
<lang limbo>implement Command; |