Skip to content

Commit

Permalink
Remove METAO_ASSIGN caching
Browse files Browse the repository at this point in the history
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 f7007ac
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions 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()) }
Expand Down

0 comments on commit f7007ac

Please sign in to comment.