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
May 25, 2016 00:02
Re: [perl #128213] No deprecation warning on literal left curlybracket in /.{/ etc
Message ID:
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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About