Skip to content
Permalink
Browse files

Remove METAO_ASSIGN caching

As discussed on #perl6-dev just now, it may cache a block that has a
incorrect version of the op, even though the name is the same.
  • Loading branch information...
lizmat committed Nov 15, 2018
1 parent 90ac094 commit f7007ac0e6ce2d544b58253d7516877c89505068
Showing with 1 addition and 19 deletions.
  1. +1 −19 src/core/metaops.pm6
@@ -1,24 +1,6 @@

my $METAOP_ASSIGN := nqp::hash;
sub METAOP_ASSIGN_NEW(\name, \op) {
nqp::if(
name,
nqp::stmts(
nqp::bindkey($METAOP_ASSIGN,name,op),
op.set_name(name.substr(0,*-1) ~ "=>"),
)
);
op
}

sub METAOP_ASSIGN(\op) {
nqp::ifnull(
nqp::atkey($METAOP_ASSIGN,op.name),
METAOP_ASSIGN_NEW(
op.name,
-> Mu \a, Mu \b { a = op.((a.DEFINITE ?? a !! op.()), b) }
)
)
-> Mu \a, Mu \b { a = op.( ( a.DEFINITE ?? a !! op.() ), b) }
}

sub METAOP_TEST_ASSIGN:<//>(\lhs, $rhs) is raw { lhs // (lhs = $rhs()) }

0 comments on commit f7007ac

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