Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
correct statement about lazyment
  • Loading branch information
gfldex committed Aug 14, 2016
1 parent c577eff commit 0abb24a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/Language/control.pod6
Expand Up @@ -367,13 +367,13 @@ of values. The values come from calls to C<take> in the dynamic scope of the C<g
}
say join ', ', $a; # 1, 5, 42
C<gather/take> generates values lazily, so the C<gather> block generally runs only until it hits
the first C<take>. Code after the first C<take> is executed as soon as the next value is consumed
from the returned sequence.
C<gather/take> can generate values lazily, depending on context. If you want to
force lazy evaluation use the L<lazy|/type/Iterable#method_lazy> subroutine or
method. Binding to a scalar or sigilless container will also force binding.
For example
my \vals = gather {
my @vals = lazy gather {
take 1;
say "Produced a value";
take 2;
Expand Down

0 comments on commit 0abb24a

Please sign in to comment.