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:
karl williamson
Date:
August 9, 2010 09:25
Subject:
Re: qr stringification: why are xism always present? I'm worriedabout backward compatibility
Message ID:
4C602BF5.9080605@khwilliamson.com
Aristotle Pagaltzis wrote:
> * Ben Morrow <ben@morrow.me.uk> [2010-08-05 20:35]:
>> * Aristotle Pagaltzis <pagaltzis@gmx.de> [2010-08-05 19:45]:
>>>>> * karl williamson <public@khwilliamson.com> [2010-08-04 15:40]:
>>>>>> FWIW, I have given this some thought, and came to the
>>>>>> conclusion that Perl is almost certainly never going to
>>>>>> change the defaults, because of the backward
>>>>>> compatibility issues.
>>> If the meaning of `(?~:)` is not allowed to change, then it
>>> will no longer be an accurate representation, so patterns
>>> will have to stringify to `(?~Xy:)`.
>> Wrong. (?~:), with no further flags, means 'The default,
>> whatever that happens to be in this version of perl'.
> 
> Don’t tell me – tell Karl. :-)

I still don't think I grok your meaning.  What Ben meant, I trust, is 
that yes the meaning of the tilde does change as new flags with defaults 
are added.  It changes to implicitly incorporate the default behavior of 
those flags.  We will have bent over backwards to keep those added 
default behaviors from affecting existing programs, so it should not 
matter to them that the meaning of the ~ "changed".  That's the whole 
point of this construct.  They can once change to ~ (or whatever it 
ended up being called), and be done with it.
> 
> 
> * karl williamson <public@khwilliamson.com> [2010-08-07 16:25]:
>> I guess I'll drop this too, as I'm apparently the last person
>> who thinks it is a good idea.  The problem with I see in
>> Aristotle's suggestion is that how do people get trained?  It's
>> not an obvious solution or we wouldn't have the various cases
>> where things break.
> 
> Yeah, that is indeed a concern. At minimum it would have to be
> included somewhere in the regex documentation for copypasting;
> probably at minimum where `qr//` is documented.
> 
> Also, a scan of CPAN for `xism` should reveal places where people
> have done it the old way; me and/or someone else(s) could go
> through these and contact the maintainers or even send patches.
> 
> Regards,


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