Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix dwim hypers to manage lazy iterables correctly
  • Loading branch information
laben committed Aug 28, 2015
1 parent 186223e commit 6e8b97b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/metaops.pm
Expand Up @@ -392,9 +392,10 @@ multi sub HYPER(&operator, Iterable:D \left, Iterable:D \right, :$dwim-left, :$d
# Check whether any side is lazy. They must not be to proceed.
if left-iterator.is-lazy {
X::HyperOp::Infinite.new(:side<both>, :&operator).throw if right-iterator.is-lazy;
X::HyperOp::Infinite.new(:side<left>, :&operator).throw;
X::HyperOp::Infinite.new(:side<left>, :&operator).throw if not $dwim-left or $dwim-right;
}
X::HyperOp::Infinite.new(:side<right>, :&operator).throw if right-iterator.is-lazy and not $dwim-right;
X::HyperOp::Infinite.new(:side<right>, :&operator).throw if right-iterator.is-lazy and
(not $dwim-right or $dwim-left);

my class DwimIterator does Iterator {
has $!source;
Expand Down

0 comments on commit 6e8b97b

Please sign in to comment.