Array concatenation: Difference between revisions

Content deleted Content added
Line 1,926:
 
=={{header|LIL}}==
LIL uses lists instead of arrays. The builtin '''append''' command could be used as '''append a $b''', but. thatThat would add the entire list in variable '''b''' as one item ofto variablelist '''a'''. TheBelow '''foreachquote''' flattensis the items of b for appendingused to a. The '''concat''' builtin would end up smushing togetherflatten the lastlists item ofinto a withsingle thenew first itemlist of ball items.
 
<lang tcl>##
Array concatenation in LIL
Line 1,932 ⟶ 1,933:
set a [list 1 2 3]
set b [list 4 5 6]
set c [quote $a $b]
foreach i $b {append a $i}
 
print $a
print [index $a 3]</lang>c
print "[index $c 0] [index $c 3]"</lang>
 
{{out}}
<pre>prompt$ lil arrayConcatenation.lil
1 2 3 4 5 6
1 4</pre>
 
=={{header|Limbo}}==