develooper Front page | perl.perl6.language | Postings from May 2006

Re: A rule by any other name...

Thread Previous | Thread Next
From:
Allison Randal
Date:
May 11, 2006 12:19
Subject:
Re: A rule by any other name...
Message ID:
44638E39.6080900@perl.org
Jonathan Scott Duff wrote:
> On Wed, May 10, 2006 at 05:58:57PM -0700, Allison Randal wrote:
>> rule:
>> - Has :ratchet and :skip turned on by default
>>
>> - May only be used inside a grammar
> 
> Should that be 
> 
> - Must be declared as part of a grammar or role
> 
> ???

It is:

- The 'rule' keyword may only be used inside a grammar

> And if we're keeping the correspondence between classes+methods and
> grammars+rules, then surely grammars are composable entities just
> like classes.

The distinction between inheritance and composition isn't as significant 
for grammars as it is for classes, since you can create a Match object 
instance from a single rule isolation.

Allison

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About