develooper Front page | perl.perl5.porters | Postings from August 2010

Re: qr stringification: why are xism always present? I'm worriedabout backward compatibility

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
August 20, 2010 05:40
Subject:
Re: qr stringification: why are xism always present? I'm worriedabout backward compatibility
Message ID:
20100820124033.GE21924@klangraum
[Note: the following reply is based on the consensus reached in
previous discussion.]

* Abigail <abigail@abigail.be> [2010-08-19 16:40]:
> After reading the entire thread, I can't say I really see the
> benefits of the proposed (?~) construct. Sure, with enough
> imagination, one can think of obscure contructs that will
> break. OTOH, in the past, I've written code that actually scans
> for (?xism:) constructs and modifies them. Such code would
> break if (?xism:) is going to be replaced with (?~:).

Such code will break anyway, because the default will soon change
to include a new flag that specifies the Unicode behaviour.

> I also don't really like the idea of "just enable whatever is
> the default on the current version of Perl". '(?si-xm:)' tells
> me exactly what's enabled, and what's disabled, regardless of
> the Perl version. (?~) doesn't tell me that.

It does tell you that: the default is forever going to have the
same semantics.

However, the flags that constitute that particular match semantic
may change over time. (Currently we’re looking at a change
Unicode behaviour.)

So a (?^:) regex in Perl 5.37 will match exactly the same things
as a corresponding (?xism:) regex matched in 5.5, even if the
default might be spelled (?xismASDFJKL) in 5.37.

So you can write code that looks for `(?^:` and be sure it will
never break.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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