Skip to content

Commit

Permalink
Add a push-all method to Supply's iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiepi committed Apr 15, 2020
1 parent dc7a796 commit e78483e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/core.c/Supply-coercers.pm6
Expand Up @@ -41,14 +41,24 @@
nqp::stmts(
(my $got := nqp::shift($!queue)),
nqp::if(
nqp::eqaddr($got, ConcQueue),
nqp::eqaddr($got,ConcQueue),
nqp::if(
nqp::isconcrete($!exception),
$!exception.throw,
IterationEnd),
$got))
}

method push-all(\target --> IterationEnd) {
nqp::stmts(
nqp::while(
nqp::not_i(nqp::eqaddr((my $got := nqp::shift($!queue)),ConcQueue)),
target.push($got)),
nqp::if(
nqp::isconcrete($!exception),
$!exception.throw))
}

# method is-lazy(--> Bool:D) { ... }
}

Expand Down

0 comments on commit e78483e

Please sign in to comment.