develooper Front page | perl.perl5.porters | Postings from May 2016

Re: [perl #128213] No deprecation warning on literal left curlybracket in /.{/ etc

Thread Previous | Thread Next
From:
Zefram
Date:
May 25, 2016 00:02
Subject:
Re: [perl #128213] No deprecation warning on literal left curlybracket in /.{/ etc
Message ID:
20160525000213.GH16984@fysh.org
demerphq wrote:
>I can understand forbidding quantifiers on an assertion, but not
>allowing it if its wrapped.

My point is that any forbidding of quantifiers on assertions should be a
purely syntactic effect.  A quantifier is syntactically permitted on (?:),
and must be allowed regardless of what is contained in the group.  If,
instead, the forbidding of quantifiers were a semantic effect, we'd get
into much woollier territory trying to define what semantically counts as
an assertion.  (/^/ is, and you'd say that /(?:^)/ is; what about /^(?:)/
or /^^/?)  It'd be much more difficult to define what's permitted in a way
that's independent of the implementation (particularly of optimisation).
Since quantifying an assertion is actually semantically meaningful,
albeit a bit insipid, we'd also run into trouble with machine-generated
or translated code.  Keeping the restriction purely syntactic avoids
all of these problems.

-zefram

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