Skip to content

Commit c21bf56

Browse files
author
Jan-Olof Hendig
committed
Adjusted formatting
1 parent a2d9188 commit c21bf56

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

doc/Type/Iterator.pod6

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ will not cause the L<die> to be called under normal use, because
2828
L<pull-one> will never be called after it returns C<IterationEnd>:
2929
3030
=begin code :skip-test
31-
my $seq = Seq.new: class :: does Iterator {
32-
method pull-one {
33-
state $x = 2;
34-
$x or die "You're under arrest for violation of Iterator protocol!";
35-
--$x ?? $x !! IterationEnd
36-
}
37-
}.new;
38-
.pull-one.say xx 10 with $seq.iterator;
39-
40-
# 1
41-
#
42-
# You're under arrest for violation of Iterator protocol!
43-
# in method pull-one at foo.p6 line 4
44-
# in block at foo.p6 line 8
45-
# in block <unit> at foo.p6 line 8
31+
my $seq = Seq.new: class :: does Iterator {
32+
method pull-one {
33+
state $x = 2;
34+
$x or die "You're under arrest for violation of Iterator protocol!";
35+
--$x ?? $x !! IterationEnd
36+
}
37+
}.new;
38+
.pull-one.say xx 10 with $seq.iterator;
39+
40+
# 1
41+
#
42+
# You're under arrest for violation of Iterator protocol!
43+
# in method pull-one at foo.p6 line 4
44+
# in block at foo.p6 line 8
45+
# in block <unit> at foo.p6 line 8
4646
=end code
4747
4848
The only valid use of the sentinel value C<IterationEnd> in a program
@@ -84,7 +84,7 @@ C<$count>.
8484
8585
my @array;
8686
say (1 .. Inf).iterator.push-exactly(@array, 3); # OUTPUT: «3␤»
87-
say @array; # [1 2 3]
87+
say @array; # OUTPUT: «[1 2 3]␤»
8888
8989
=head2 method push-at-least
9090
@@ -105,7 +105,7 @@ produce more elements to achieve better performance.
105105
106106
my @array;
107107
say (1 .. Inf).iterator.push-at-least(@array, 10); # OUTPUT: «10␤»
108-
say @array; # [1 2 3 4 5 6 7 8 9 10]
108+
say @array; # OUTPUT: «[1 2 3 4 5 6 7 8 9 10]␤»
109109
110110
=head2 method push-all
111111

0 commit comments

Comments
 (0)