Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #519 from laben/glr
Fix dwim hypers to manage lazy iterables correctly
  • Loading branch information
moritz committed Aug 28, 2015
2 parents 186223e + 6e8b97b commit fc8ab7e
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 fc8ab7e

Please sign in to comment.