On Fri, Feb 17, 2006 at 08:32:18AM -0600, Patrick R. Michaud wrote:
: > The synopsis says:
: > 
: > * If a subrule appears two (or more) times in the same lexical scope
: >   (i.e. twice within the same subpattern and alternation), or if the
: >   subrule is quantified anywhere within the entire rule, then its
: >   corresponding hash entry is always assigned a reference to an array
: >   of Match objects, rather than a single Match object.
: > 
: > Maybe you're not the right person to ask, but is there a particular
: > reason for the "entire rule" bit?
: > 
: > / (<foo>|None) <foo> (<foo>) /
: > 
: > Here we get three Matches $0<foo> (possibly undefined), $<foo>, and
: > $1<foo>. At least, I think so.
: > 
: > / (<foo>?) <foo> (<foo>) /
: > 
: > Now, we suddenly get three more or less unrelated arrays with lengths
: > 1..1, 1, and 1. Of course, I admit this example is a bit artificial.
: 
: Oh, I hadn't caught that particular clause (or hadn't read it as
: you just did).  PGE certainly doesn't implement things that way.
: I think the "entire rule" clause was intended to cover cases like
: 
:     / [ <foo> ]* /
: 
: where <foo> is indirectly quantified and therefore is an array of
: match objects.  We should probably reword it, or get a clarification
: of what is intended.  (Damian, @Larry:  can you confirm or clarify
: this for us?)

I believe that was the intent, but I'll defer to Damian on the wordsmithing
because I'm a bit out of sorts at the moment and it'd probably come out
all sideways.

Larry

Reply via email to