Skip to content

Commit

Permalink
remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Nov 17, 2016
1 parent 3ca220b commit c40ccb5
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions doc/Type/List.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +929,11 @@ Defined as:
sub zip(+@e, :&with) returns Seq:D
Builds a 'list of lists', returned as a sequence, from multiple input lists or
Builds a 'list of lists', returned as a sequence, from multiple input lists or
other L<iterables|/type/Iterable>.
C<zip> iterates through each of the input lists synchronously, 'Zipping' them
together, so that elements are grouped according to their input list index, in
together, so that elements are grouped according to their input list index, in
the order that the lists are provided.
say zip(<a b c>, <d e f>, <g h i>);
Expand All @@ -952,16 +952,16 @@ C<zip> can provide input to a for loop :
, or more succinctly :
say .join(",") for zip <a b c>, <d e f>, <g h i>; # same output
Note, that if the input lists have an unequal number of elements, then
C<zip> terminates once the shortest input list is exhausted, and trailing
say .join(",") for zip <a b c>, <d e f>, <g h i>; # same output
Note, that if the input lists have an unequal number of elements, then
C<zip> terminates once the shortest input list is exhausted, and trailing
elements from longer input lists are discarded.
say <a b c> Z <d e f m n o p> Z <g h i>;
# ((a d g) (b e h) (c f i))
In cases where data clipping is possible, but undesired, then consider using
In cases where data clipping is possible, but undesired, then consider using
L<roundrobin|/type/List#sub_roundrobin> instead of C<zip>.
The optional C<with> parameter will additionally reduce the zipped lists. For
Expand All @@ -984,10 +984,10 @@ Defined as:
method roundrobin(List:D:) returns Seq
Builds a 'list of lists', returned as a sequence, from multiple input lists or
Builds a 'list of lists', returned as a sequence, from multiple input lists or
other L<iterables|/type/Iterable>. C<roundrobin> returns an identical result to
that of L<zip|/type/List#routine_zip>, except when the input lists have an
unequal number of elements.
that of L<zip|/type/List#routine_zip>, except when the input lists have an
unequal number of elements.
say roundrobin <a b c>, <d e f>, <g h i>;
# ((a d g) (b e h) (c f i))
Expand All @@ -996,7 +996,7 @@ unequal number of elements.
# 1,2,3
# 2,3,4
C<roundrobin> does not terminate once one or more of the input lists become
C<roundrobin> does not terminate once one or more of the input lists become
exhausted, but proceeds until all elements from all lists have been processed.
say roundrobin <a b c>, <d e f m n o p>, <g h i j>;
Expand All @@ -1007,10 +1007,10 @@ exhausted, but proceeds until all elements from all lists have been processed.
# 2,3,4
# 57,102
# 77
Therefore no data values are lost due in the 'zipping' operation. A record of
which input list provided which element cannot be gleaned from the resulting
sequence, however.
Therefore no data values are lost due in the 'zipping' operation. A record of
which input list provided which element cannot be gleaned from the resulting
sequence, however.
C<roundrobin> can be useful in combining messy data to the point where a manual
post-processing step can then be undertaken.
Expand Down

0 comments on commit c40ccb5

Please sign in to comment.