RosettaCodeData/Task/Loop-over-multiple-arrays-simultaneously/Tailspin/loop-over-multiple-arrays-simultaneously-4.tailspin
2024-10-16 18:07:41 -07:00

25 lines
430 B
Text

x is ['a', 'b', 'c'];
y is ['A', 'B', 'C'];
z is [1, 2, 3];
u is ['a', 'b'];
v is ['A', 'B', 'C'];
w is [1];
transpose2 templates
@ set [];
$... -> $(.. as i; -> templates
when <|?($i matches <|..$@transpose2::length>)> do ..|@transpose2($i) set $;
otherwise ..|@transpose2 set [$];
end) -> !VOID
$@ !
end transpose2
[$x, $y, $z] -> transpose2... -> '$...;
' !
'
' !
[$u,$v,$w] -> transpose2... -> '$...;
' !