Skip to content
Permalink
Browse files

s/Iterator/PredictiveIterator/ for native shaped arrays

  • Loading branch information...
lizmat committed Sep 9, 2018
1 parent be07f30 commit 5cbbcc6e5c97b1a171d5c7d5cbd742f5ab64fd1e
Showing with 19 additions and 15 deletions.
  1. +15 −12 src/core/native_array.pm6
  2. +4 −3 tools/build/makeNATIVE_SHAPED_ARRAY.p6
@@ -1658,7 +1658,7 @@ my class array does Iterable {
}

#- start of generated part of shapedintarray role -----------------------------
#- Generated on 2018-06-09T09:16:36+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- Generated on 2018-09-09T16:19:43+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE

role shapedintarray does shapedarray {
@@ -2013,7 +2013,7 @@ my class array does Iterable {
)
}
method iterator(::?CLASS:D:) {
class :: does Iterator {
class :: does PredictiveIterator {
has Mu $!list;
has int $!pos;
method !SET-SELF(Mu \list) {
@@ -2045,8 +2045,9 @@ my class array does Iterable {
($!pos = $pos)
)
}
method count-only() { nqp::p6box_i(nqp::elems($!list)) }
method bool-only() { nqp::hllbool(nqp::elems($!list)) }
method count-only() {
nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list)
}
@@ -2209,7 +2210,7 @@ my class array does Iterable {
#- end of generated part of shapedintarray role -------------------------------

#- start of generated part of shapednumarray role -----------------------------
#- Generated on 2018-06-09T09:16:36+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- Generated on 2018-09-09T16:19:43+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE

role shapednumarray does shapedarray {
@@ -2564,7 +2565,7 @@ my class array does Iterable {
)
}
method iterator(::?CLASS:D:) {
class :: does Iterator {
class :: does PredictiveIterator {
has Mu $!list;
has int $!pos;
method !SET-SELF(Mu \list) {
@@ -2596,8 +2597,9 @@ my class array does Iterable {
($!pos = $pos)
)
}
method count-only() { nqp::p6box_i(nqp::elems($!list)) }
method bool-only() { nqp::hllbool(nqp::elems($!list)) }
method count-only() {
nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list)
}
@@ -2760,7 +2762,7 @@ my class array does Iterable {
#- end of generated part of shapednumarray role -------------------------------

#- start of generated part of shapedstrarray role -----------------------------
#- Generated on 2018-06-09T09:16:36+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- Generated on 2018-09-09T16:19:43+02:00 by tools/build/makeNATIVE_SHAPED_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE

role shapedstrarray does shapedarray {
@@ -3115,7 +3117,7 @@ my class array does Iterable {
)
}
method iterator(::?CLASS:D:) {
class :: does Iterator {
class :: does PredictiveIterator {
has Mu $!list;
has int $!pos;
method !SET-SELF(Mu \list) {
@@ -3147,8 +3149,9 @@ my class array does Iterable {
($!pos = $pos)
)
}
method count-only() { nqp::p6box_i(nqp::elems($!list)) }
method bool-only() { nqp::hllbool(nqp::elems($!list)) }
method count-only() {
nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list)
}
@@ -396,7 +396,7 @@ for $*IN.lines -> $line {
)
}
method iterator(::?CLASS:D:) {
class :: does Iterator {
class :: does PredictiveIterator {
has Mu $!list;
has int $!pos;
method !SET-SELF(Mu \list) {
@@ -428,8 +428,9 @@ for $*IN.lines -> $line {
($!pos = $pos)
)
}
method count-only() { nqp::p6box_i(nqp::elems($!list)) }
method bool-only() { nqp::hllbool(nqp::elems($!list)) }
method count-only() {
nqp::p6box_i(nqp::elems($!list) - $!pos - 1)
}
method sink-all(--> IterationEnd) {
$!pos = nqp::elems($!list)
}

0 comments on commit 5cbbcc6

Please sign in to comment.
You can’t perform that action at this time.