On Wed, May 25, 2005 at 08:28:11AM -0700, Mark A. Biggar wrote:
> Jeff 'japhy' Pinyan wrote:
> >Yeah, that was going to be my next step, except that the unknowing 
> >person might make a sub-rule of their own called, say, "Zs", and then 
> >which would take precedence?  Perhaps <prop:X> is a good way of writing it.
> 
> Well we have the same problem with someone redefining 'digit'.  But 
> character classes are their own sub-language and we may need to
> distinguish between Rule::digit and CharClass::digit in the syntax.  

Larry makes the case that "character classes really are rules of
a sort" in http://www.nntp.perl.org/group/perl.perl6.language/21120.
Essentially, since characters are no longer fixed-width entities,
the distinction between "character class" and "rule" can get pretty
fuzzy, and so we're probably better off not trying to force one.

It may simply be that in general a character class expression like

    <+alnum-[aeiou]+punct>

ends up decomposing into something like

    [ <![aeiou]><?alnum> | <?punct> ]

which doesn't make any assumptions about character widths.  Of course,
the rules engine would (eventually) be written to recognize the common
compositions and "character class" subrules and optimize for them.

Pm

Reply via email to