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

Versioned 'strict'

Thread Next
From:
Paul "LeoNerd" Evans
Date:
September 11, 2014 18:28
Subject:
Versioned 'strict'
Message ID:
20140911192814.7e9a1613@shy.leonerd.org.uk
I live in eternal hope that one day, one day, we'll get around to
implementing in core some more strictness flags than the current
ancient set of three (vars, subs, refs).[*]

To allow for the unfortunate back-compat issues that would arise if we
added, say, a fourth flag of "directness" (to implement the current "no
indirect" ability, for example), it would be nice to be able to request
the set of strictness flags present in some particular version.

To that end, I'd like to suggest that we allow

  use strict ':5.20';

say, to mean "that set of flags present by default in 5.20"

((Implementation-wise I think it should be fairly trivial to just store
  a hash in strict.pm of all the "current" flags, and the version at
  which they appeared, presuming for now we don't never delete any.))

For back-compat reasons I don't think we'd ever be able to change the
default meaning of

  use strict;

but it would be nice some day in a few years time to be able to

  use v5.30;
  use strict ':v5.30';

and have a bunch more strictnesses that that entails, whatever they may
be.

-----

[*]: My particular horse in this race is 'stringification':

  no stringification;

  my $array = [ 1, 2, 3 ];

  print "My array is $array\n";  # dies

  https://metacpan.org/pod/release/PEVANS/stringification-0.01_004/lib/stringification.pm

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
http://www.leonerd.org.uk/  |  https://metacpan.org/author/PEVANS

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