Skip to content

Commit b56885b

Browse files
committed
Improve documents on set ops
1 parent ce6e019 commit b56885b

File tree

2 files changed

+71
-73
lines changed

2 files changed

+71
-73
lines changed

doc/Language/list.pod6

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ One of the ways C<@>-sigiled variables act like lists is by always supporting
9494
L<positional subscripting|/language/subscripts>. Anything bound to a C<@>-sigiled
9595
value must support the L<Positional|/type/Positional> role which guarantees this:
9696
97-
=begin code
9897
my @a := 1; # Type check failed in binding; expected Positional but got Int
99-
=end code
10098
10199
=head1 Reset a List Container
102100
@@ -145,14 +143,14 @@ not provide the full interface of C<Positional>, so an C<@>-sigiled variable
145143
may B<not> be bound to a C<Seq>.
146144
147145
my @s := Seq.new(<a b c>); CATCH { default { say .^name, ' ', .Str } }
148-
# OUTPUT«Type check failed in binding to $iter; expected Iterator but got List ($("a", "b", "c"))␤ in block <unit> at <tmp> line 1␤␤»
146+
# OUTPUT «Type check failed in binding to $iter; expected Iterator but got List ($("a", "b", "c"))␤ in block <unit> at <tmp> line 1␤␤»
149147
150148
This is because the C<Seq> does not keep values around after you have used them.
151149
This is useful behavior if you have a very long sequence, as you may want to
152150
throw values away after using them, so that your program does not fill up memory.
153151
For example, when processing a file of a million lines:
154152
155-
=begin code :skip-test
153+
=begin code :preamble<sub do-something-with($x){ }>
156154
for 'filename'.IO.lines -> $line {
157155
do-something-with($line);
158156
}

0 commit comments

Comments
 (0)