develooper Front page | perl.perl5.porters | Postings from September 2014

Re: RFC: implementing script runs

Thread Previous | Thread Next
From:
demerphq
Date:
September 29, 2014 14:39
Subject:
Re: RFC: implementing script runs
Message ID:
CANgJU+VN45sC980-w++XhcEqiexHB56p-SBibc5hYhGRhwzsCA@mail.gmail.com
On 29 September 2014 16:18, Abigail <abigail@abigail.be> wrote:

> On Mon, Sep 29, 2014 at 07:48:31AM -0600, Tom Christiansen wrote:
> > Abigail <abigail@abigail.be> wrote on Mon, 29 Sep 2014 15:08:56 +0200:
> >
> > >On Mon, Sep 29, 2014 at 08:41:30AM -0400, Ricardo Signes wrote:
> >
> > >> * Abigail <abigail@abigail.be> [2014-09-29T04:59:16]
> >
> > >> I wonder if, rather than affecting the previous atom, it wouldn't be
> more
> > >> useful to set a scope for single-script matching.
> > >>
> > >>   (?«onescript»:\w+\d+\.\d+)
> > >>
> > >> I really haven't given this deep thought.  It just popped into my
> head<SNIP>
> > >> heading out, so I'm getting it written down before I forget to think
> a<SNIP>
> > >> more.
> >
> > Too bad /o was long ago already taken.
> >
> > > I think that's a better syntax that either the proposed quantifier
> > > modifier, or the escape sequences, as you can enforce longer
> (sub)patterns
> > > to be in one script than just a run.
> >
> > > It's on par with the modifier proposal when it comes to usefulness,
> except
> > > that your proposal doesn't use a single letter modifier (another thing
> we
> > > won't have an endless supply off either), but uses a full word.
> >
> > I again wonder about collecting multiples of the long modifiers, maybe:
> >
> >     (?{onescript,insensitive}:...)
> >
> > Except that (?{ is taken.  So is (?< and IIRC also now (?[.   We've run
> > out of opening/closing paired ASCII stuff.  (?(  is just not reasonable.
>
> I think that of (?<, only (?<!, (?<=, and (?<ALPHA are taken. So, there
> is some room left, for instance:
>
>     (?<:onescript,insenstive,!comment,ignorespace>PAT)
>

FWIW, I dont think this works very well. I dislike how it makes a typo fo

(?<name>....)

into this new syntax.

I would prefer we use (+....) or (*....) for this instead.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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