Skip to content

Commit

Permalink
Update Rakudo::Iterator to not use $!whence
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jun 15, 2018
1 parent e31f830 commit 82702e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/Perl6/Metamodel/ContainerDescriptor.nqp
Expand Up @@ -36,8 +36,10 @@ role Perl6::Metamodel::ContainerDescriptor::Whence {
has $!next-descriptor;

method next() {
nqp::ifnull($!next-descriptor,
($!next-descriptor := nqp::gethllsym('perl6', 'default_cont_spec')))
my $next := $!next-descriptor;
nqp::isconcrete($next)
?? $next
!! ($!next-descriptor := nqp::gethllsym('perl6', 'default_cont_spec'))
}
method of() { self.next.of }
method default() { self.next.default }
Expand Down
8 changes: 2 additions & 6 deletions src/core/Rakudo/Iterator.pm6
Expand Up @@ -2496,12 +2496,8 @@ class Rakudo::Iterator {
method new(\arr, Mu \des) { nqp::create(self)!SET-SELF(arr, des) }

method !hole(int $i) is raw {
nqp::p6bindattrinvres(
(my \v := nqp::p6scalarfromdesc($!descriptor)),
Scalar,
'$!whence',
-> { nqp::bindpos($!reified,$i,v) }
)
nqp::p6scalarfromdesc(ContainerDescriptor::BindArrayPos.new(
$!descriptor, $!reified, $i))
}
method pull-one() is raw {
nqp::ifnull(
Expand Down

0 comments on commit 82702e9

Please sign in to comment.