Luke Palmer wrote:

> I just read through A5 (wow, that's long), and I agree with most of it.
> Some of it's really cool. Here's what makes me uneasy: The fact that a
> grammar rule auto-captures into a variable of its name.
> 
> Is this efficient?  If I'm writing a syntax-directed translator, I usually
> don't need to capture the rules. The rules are run for their side-effects.
> I definitely see the win, but I see a lose in it too.  Seems like an awful
> lot of memory's going to be wasted if I'm matching a big file with one
> C<$grammar.match>.
>
> Is there a way to tell it I<not> to capture something from a grammar rule?
> Should auto-capture really be default?  Is someone going to tell me "well,
> it's really not inefficient because ... optimizes ...."  That would
> relieve me greatly.

There will be plenty of scope for optimization where perl can detect that the
values returned named subregexes are never referred to. The easiest way to
turn such optimizations on is to match in a boolean, string, or numeric context.


> I am waiting eagerly for Exegesis 5 :)

Me too.

;-)

Damian

Reply via email to