On Mon, Nov 07, 2005 at 03:05:06PM -0800, Larry Wall wrote:
> On Mon, Nov 07, 2005 at 02:47:05PM -0600, Patrick R. Michaud wrote:
> : > : But for the :w issue, we can always solve it with the colon:
> : > : 
> : > :     \d:065     = A digit (cut) followed by "065"
> : > 
> : > That doesn't extend to \d:woot, of course...
> : 
> : It doesn't?  I mean, isn't that a digit followed by "woot"?
> 
> No, it's a digit followed by ":woot".  Adverbs aren't currently
> restricted to being at the front of a sequence.  I think a backtracking
> colon can't have an alphanumeric right after it or it's taken as
> an adverb.

Oh.  I was figuring that modifiers (:w, :i, etc.) would only 
appear at the beginning of a rule or the beginning of a group,
and would be scoped to that rule/group.  The examples in S05/A05
all display it in that manner.

> We *could* restrict adverbs to the front.  Would have to think about
> the ramifications of that though...

I would think it wouldn't be too much of an issue, since one
can always introduce a group to provide a front for the modifier
(and scopes it as well) -- i.e.:

   rx :w / the :i quick :i(0) brown :i fox :i(0) jumped /

seems simpler as

   rw :w / the [:i quick] brown [:i fox] jumped /

It's also nicer because that means a ':' not at the beginning
of a rule/group is always a cut, regardless of what follows.  
And we also get \d:0123 as a cheap way of saying \d<?null>0123.  

(And the parsing of colon becomes simpler/faster because I don't 
have to do a procedural lookahead, but hey, that's beside the 
point. :-)

Pm

Reply via email to