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

Re: Perl 5.16 and Beyond.

Thread Previous | Thread Next
From:
John Imrie
Date:
September 13, 2011 16:30
Subject:
Re: Perl 5.16 and Beyond.
Message ID:
4E6FE78A.9050804@virginmedia.com
On 13/09/2011 22:07, Jesse Vincent wrote:
>
> On Sep 13, 2011, at 4:48 PM, Ævar Arnfjörð Bjarmason wrote:
>
>> I agree with all the backward compatibility *goals*, but I think 
>> redefining "v5.x" to mean "exactly v5.x" instead of "equal or greater 
>> than v5.x" is a bit contrary to that aim.
>>
> The point of the new semantics for "use v5.x" is to insulate code from 
> changes to Perl's defaults. Keeping the existing semantics ensures 
> that programs will break as we make changes to Perl's defaults.
>
> We should certainly have some way for developers who want their code 
> to get "the running Perl's semantics, whether it's 5.16 or 5.36" to 
> hurt themselves if they want to, but it really should not be the default.
>
>
Would one of the following pragma  work

use latest;
use version::latest;
use latest::version;

Then we have

use 5.x where x <16 := use at least version 5.x

use 5.x where x >= 16 := use exactly version 5.x, with all the semantics 
of that version except I'd like to propose it really means use the max 
known version of the interpreter of version 5.x.00 to 5.x.99

use latest := Use the semantics of the interpreters version;

This gives us the opportunity to do something like

use latest;
my @features = latest::features;
die "no given/when" unless grep {$_ eq 'switch'} @features

John

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