Navigation
Synopsis Make a list of pairs from two (three) lists of the same length.
Function
  1. list[tuple[&T first, &U second]] zip(list[&T] a, list[&U] b)
  2. list[tuple[&T first, &U second, &V third]] zip(list[&T] a, list[&U] b, list[&V] c)
Usage import List;
Description Also see unzip.
Examples
rascal>import List;
ok
rascal>zip([3, 1, 4], ["thirty", "ten", "forty"]);
lrel[int first,str second]: [
  <3,"thirty">,
  <1,"ten">,
  <4,"forty">
]
rascal>zip([3, 1, 4], ["thirty", "ten", "forty"], [300, 100, 400]);
lrel[int first,str second,int third]: [
  <3,"thirty",300>,
  <1,"ten",100>,
  <4,"forty",400>
]

Questions
Question [1].
zip([-12, 18, 17, 19], [-11, -12, -12, -7]) == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.