I think you meant something akin to C< /(.) { use PIR; print P0;}/ > and C< /(.) { use Forth; P0 print}/ > :-) As long as we're special-casing
things and "hand parsing" we might as well use a small subset of Perl)
Is perl actually going to allow arbitrary languages in the closures for REs? For languages that don't have a clean notion of closures or a friend idea of how to use curly brases, this sounds like quite a feature to implement even with a full perl6 compiler to start with.
Why not say the closures in perl's RE are always in perl (ignoring macros) and that you have to have eval functions/macros for the other languages like :
rx{ <<foo>> { PIR :P0($<<foo>>) { print P0 } } rx{ <foo> { PIR<< print P0 >>} } rx{ <foo> { PIR <<EOPIR print P0 EOPIR } }
I guess saying PIR in every rule might get repetitive. It would be easy to special case in the bootstrap parser and would work in a way that would seem to make regular perl REs easier to manage.
Dan