Patrick R. Michaud wrote:
On Fri, Sep 12, 2008 at 04:55:39PM -0700, [EMAIL PROTECTED] wrote:
Log:
[rakudo] If we are calling ACCEPTS in a multi-dispatch to do a
type-check, then because blocks are not differentiated from
regexes at the moment we get exceptions when trying to store $/.
This patch wraps that code up in a handler.
I'd be happy to get PGE to attach whatever attributes or re-bless
the subs it generates to be Regex subs if we can come up with
a reasonably clean way to do that.
I've pretty much decided I don't like the "attach the proto as a
property so we know what type it is" approach, since we then have to lie
about types in various places. So I think it's going to be a re-blessing
of some sort. We just need to work out exactly what, and where. I guess
it's possible in loadinit...but we maybe wouldn't need PGE's help on
that, since it's a property of a PAST::Block. OTOH, PGE's output
survives as PIR until POST, so there may not be a lexid to attach the
loadinit to? I don't know how it looks down at that level without
checking. :-)
(I really hoped :instanceof was going to help us with this by letting us
just create the right type in the first place, and I suspect we actually
can do it with Parrot Object types rather than PMCs with a little bit of
extra effort too, but so long as we have both closure and sub PMCs
around it's a bit tricky, as we found out before. Maybe future changes
and fixes will resolve this for us.)
Jonathan