Skip to content

Commit

Permalink
add Seq.is-ready for debugging purposes
Browse files Browse the repository at this point in the history
it returns False if this Seq has already been iterated
  • Loading branch information
moritz committed Aug 25, 2015
1 parent 508d223 commit ab408b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/Seq.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ my class Seq is Cool does Iterable does PositionalBindFailover {
$seq
}

method is-ready(Seq:D:) { $!iter.DEFINITE }

method iterator(Seq:D:) {
my \iter = $!iter;
X::Seq::Consumed.new.throw unless iter.DEFINITE;
Expand Down

0 comments on commit ab408b1

Please sign in to comment.