I have submitted a simple 'match' implementation for rakudo (method
version of m//, RT#56970) and ran into an odd issue. The current
version of match which works uses a tail call:
.sub 'match' :method
.param pmc x
.return x.ACCEPTS(self)
.end
If I try the following:
.sub 'match' :method
.param pmc x
.local pmc match
match = x.ACCEPTS(self);
.return (match)
.end
I run into 'Null PMC access in set_pmc_keyed()' with ACCEPTS (below),
which is failing to get the LexPad:
.sub 'ACCEPTS' :method
.param pmc topic
.local pmc match
match = self(topic)
$P0 = getinterp
$P1 = $P0['lexpad';1]
$P1['$/'] = match
.return (match)
.end
If I simply change match to mimic ACCEPTS, everything works fine.
This makes me think something is going on with lexicals, but I'm not
quite sure. Am I missing something?
chris