Loop over multiple arrays simultaneously: Difference between revisions

→‎{{header|Diego}}: added arrays of diff. len.
(→‎{{header|Diego}}: added arrays of diff. len.)
Line 1,111:
 
=={{header|Diego}}==
<lang diego>set_nsset namespace(rosettacode);
 
add_mat(myMatrix)_row(a,b,c)_row(A,B,C)_row(1,2,3);
Line 1,122:
me_msg([output]);
 
reset_nsreset_namespace[];</lang>
 
Diego has no issue when arrays are of a different length, the "missing" array entries will handled as empty. Note, the <code></code>matrix</code> will become a <code>clump</code>, but can still be treated as a <code>matrix</code>.
<lang diego>set ns(rosettacode);
 
add_clump(myClump)_row(a,b,c,d,e,f)_row(A,B,C,D)_row(-1,0,1,2,3);
add_var(output);
with_clump(myClump)_foreach()_bycol()_var(columnArray)
with_var(output)_append()_flat([columnArray])_append(\n);
;
me_msg([output]);
reset_ns[];</lang>
{{out}}
<pre>
aA-1
bB0
cC1
dD2
e3
f
</pre>
 
=={{header|DWScript}}==