[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    Re: feature.pm proposal
From:       Father Chrysostomos <sprout () cpan ! org>
Date:       2011-10-31 5:59:25
Message-ID: 318D8E68-A8FC-4CE5-A6DD-064933E26E11 () cpan ! org
[Download RAW message or body]

Aristotle wrote:
> What you really want to happen is for provenance to be remembered. In
> case of
> 
>     use strict;
>     use 5.010;
> 
> you want strictures to be enabled because they were enabled explicitly.
> But in case of
> 
>     use 5.012;
>     use 5.010;
> 
> you want them disabled, because they were only implicitly enabled by way
> of a version feature bundle.
> 
> I’d also argue by the same token that
> 
>     use feature 'unicode_strings';
>     no 5.014;
> 
> should leave `unicode_strings` enabled.

Unfortunately, no 5.014 already means something else.

$ perl5.15.4 -M-5.014
Perls since v5.14.0 too modern--this is v5.15.4, stopped.
BEGIN failed--compilation aborted.

I think making

    use feature 'unicode_strings';
    use 5.010;

leave the feature enabled might be going a bit to far.  It makes it
harder to document.  If we say that use-version enables the feature
bundle for that version, then we have to go through contortions to
explain that it doesn't really.

> 
> 
> We don’t have a mechanism to do that.
> 
> I’m not sure how feasible it would be to retrofit.
> 
> Though on reflection it might even be very easy, since I think only
> feature.pm needs some extra code – if the enabling of strictures is
> retroactively re-cast as a feature, it might even not require touching
> anything else. I’m not sure.

strict would have to be remembered in two places.  "use strict" would
have to turn on strict the usual way *and* turn off the strict
features, so that feature.pm knows not to disable strict.  That is
quite doable.

If $[ is to be disabled under 5.16, then I think we do need something
like that.  $[ will become a part of the 5.14 bundle (and lower
versions).  "use v5.16" will disable it, as not being part of the
5.16 bundle.

Leon Timmermans suggested that strictures become fatal warnings.  I
could never figure out a way to stop "no warnings" from turning off
strict, though.  Maybe it could be based on this somehow.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic