Skip to content

Commit

Permalink
Revert "Make X die on various forms of lazy sequences"
Browse files Browse the repository at this point in the history
This reverts commit 2a7c27a.
  • Loading branch information
lizmat committed Jan 16, 2017
1 parent 3e373ff commit 9537ccd
Showing 1 changed file with 2 additions and 50 deletions.
52 changes: 2 additions & 50 deletions src/core/Rakudo/Iterator.pm
Expand Up @@ -561,12 +561,7 @@ class Rakudo::Iterator {

# need to set up an iterator
nqp::stmts(
nqp::if($elem.is-lazy,
nqp::stmts(
self!die-if-not-sane($i),
($!lazy = 1)
)
),
nqp::if($elem.is-lazy,($!lazy = 1)),
nqp::if(
nqp::eqaddr(
(my $pulled :=
Expand Down Expand Up @@ -595,25 +590,6 @@ class Rakudo::Iterator {
self
)
}
# sanity check for handling 1,2 X 1..*
method !die-if-not-sane($from) {
nqp::stmts(
(my int $i = $from),
nqp::while(
nqp::isge_i(($i = nqp::sub_i($i,1)),0),
nqp::stmts(
nqp::unless(
nqp::isnull(nqp::atpos($!iterators,$i)),
(die "Can only have one lazy sequence in a cross")
),
nqp::if(
nqp::isgt_i(nqp::elems(nqp::atpos($!reifieds,$i)),1),
(die "Can only have single element lists before a lazy sequence in a cross")
)
)
)
)
}
method new(\iterables) { nqp::create(self)!SET-SELF(iterables) }
method pull-one() {
nqp::if(
Expand Down Expand Up @@ -847,12 +823,7 @@ class Rakudo::Iterator {

# need to set up an iterator
nqp::stmts(
nqp::if($elem.is-lazy,
nqp::stmts(
self!die-if-not-sane($i),
($!lazy = 1)
)
),
nqp::if($elem.is-lazy,($!lazy = 1)),
nqp::if(
nqp::eqaddr(
(my $pulled :=
Expand Down Expand Up @@ -882,25 +853,6 @@ class Rakudo::Iterator {
self
)
}
# sanity check for handling 1,2 X 1..*
method !die-if-not-sane($from) {
nqp::stmts(
(my int $i = $from),
nqp::while(
nqp::isge_i(($i = nqp::sub_i($i,1)),0),
nqp::stmts(
nqp::unless(
nqp::isnull(nqp::atpos($!iterators,$i)),
(die "Can only have one lazy sequence in a cross")
),
nqp::if(
nqp::isgt_i(nqp::elems(nqp::atpos($!reifieds,$i)),1),
(die "Can only have single element lists before a lazy sequence in a cross")
)
)
)
)
}
method new(\its,\map) { nqp::create(self)!SET-SELF(its,map) }
method pull-one() {
nqp::if(
Expand Down

0 comments on commit 9537ccd

Please sign in to comment.