@@ -345,8 +345,9 @@ quickly.
345
345
346
346
= head1 Zip Operators
347
347
348
- The zip metaoperator, C < Z > , will apply a given infix operator to pairs taken
349
- one left, one right, from its arguments. The resulting list is returned.
348
+ The zip metaoperator, (which is not the same thing as L < Z|#infix_Z > ), will
349
+ apply a given infix operator to pairs taken one left, one right, from its
350
+ arguments. The resulting list is returned.
350
351
351
352
my @l = <a b c> Z~ 1, 2, 3; # [a1 b2 c3]
352
353
@@ -2007,13 +2008,15 @@ sub infix:<Z>(**@lists) returns List:D is assoc<chain>
2007
2008
2008
2009
X < Zip operator > .
2009
2010
2010
- Interleaves the lists passed to C < Z > like a zipper, stopping as soon as
2011
- the first input list is exhausted:
2011
+ Interleaves the lists passed to C < Z > like a zipper, stopping as soon as the
2012
+ first input list is exhausted. The returned C < Seq > contains a nested list with
2013
+ values for all C < Z > operators in a chain.
2012
2014
2013
2015
say (1, 2 Z <a b c> Z <+ ->).perl; #=> ((1, "a", "+"), (2, "b", "-")).Seq
2014
2016
for <a b c> Z <1 2 3> -> $l, $r {
2015
2017
say "$l:$r"
2016
2018
}
2019
+ OUTPUT « a:1b:2c:3 »
2017
2020
2018
2021
The C < Z > operator also exists as a meta operator, in which case the inner
2019
2022
lists are replaced by the value from applying the meta'ed operator to the
0 commit comments