develooper Front page | perl.perl5.porters | Postings from February 2009

use 5.XXXYYY (was Re: ...st_birthtime...)

Thread Next
From:
David Golden
Date:
February 28, 2009 03:45
Subject:
use 5.XXXYYY (was Re: ...st_birthtime...)
Message ID:
5d4beb40902280345m3067d1abx74d2e69f49dc807@mail.gmail.com
On Sat, Feb 28, 2009 at 12:53 AM, Abigail <abigail@abigail.be> wrote:
> No, please, let's not. Let's keep the meaning of "use 5.X" reasonable
> safe. It should mean "hey, compiler, I promise you, I'm not using any
> of the new keywords as user subs". In the vast majority of the cases,
> leaving off 'use 5.X' should either make no difference (if no feature
> is used), or result in a compile time error (if a new feature is used).
>
> It shouldn't mean the program will behave differently in a subtle, and
> hard to debug, way.

This is worth a broader debate, I think.  I'd much rather see "use
5.XXXYYY" to mean "hey, compiler, I promise you that I expect a
certain default behavior -- you don't need to worry about being
backwards compatible for code that might have been written a decade
ago for 5.004"

It's a logical extension of "use 5.010" also having the effect of "use
feature ':5.10'".  It just means that 'feature' is used not only for
new syntax but for semantic changes or extensions to existing syntax.

feature could also be used for automatic enabling of other pragmata --
or that could be attached to the "use 5.XXXYY".  I.e. if there were a
'pragmas.pm' that enabled/disabled pragma bundles the same way that
feature enables/disables feature bundles, then it would work like this

    use 5.XXXYYY;
    # also does: use pragmas ':5.10';

Then "use pragmas ':5.12'" could, for example, do "use strict; use
warnings: use feature ':5.12'" and so on.

-- David

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