Skip to content

Commit

Permalink
{s/Seq/Iterate/}NextNFromIterator
Browse files Browse the repository at this point in the history
A utility function working on iterators creating iterators is much
more generally usable.
  • Loading branch information
lizmat committed Oct 21, 2016
1 parent 66726e8 commit f75da76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/Any-iterable-methods.pm
Expand Up @@ -1894,7 +1894,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
nqp::if(
nqp::isle_i($n,0),
(),
Rakudo::Internals.SeqNextNFromIterator(self.iterator,$n)
Seq.new(Rakudo::Internals.IterateNextNFromIterator(self.iterator,$n))
)
}

Expand Down
8 changes: 4 additions & 4 deletions src/core/Rakudo/Internals.pm
Expand Up @@ -259,9 +259,9 @@ my class Rakudo::Internals {
}.new(seq-from-seqs))
}

# create Seq for the next N elements of given iterator
method SeqNextNFromIterator(\iterator,\times) {
Seq.new(class :: does Iterator {
# create iterator for the next N elements of given iterator
method IterateNextNFromIterator(\iterator,\times) {
class :: does Iterator {
has $!iterator;
#?if !jvm
has int $!times;
Expand Down Expand Up @@ -291,7 +291,7 @@ my class Rakudo::Internals {
IterationEnd
)
}
}.new(iterator,times))
}.new(iterator,times)
}

# create Seq that skips N elements of given iterator
Expand Down

0 comments on commit f75da76

Please sign in to comment.