develooper Front page | perl.perl5.porters | Postings from June 2015

Re: for 5.24: new categories for strict/warnings?

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
June 5, 2015 10:13
Subject:
Re: for 5.24: new categories for strict/warnings?
Message ID:
20150605101308.GA46179@plasmasturm.org
* Ricardo Signes <perl.p5p@rjbs.manxome.org> [2015-06-03 15:20]:
> (Meanwhile, "no warnings;" and "no strict;" should act on 'all', of
> course.)

How is it sane for `use foo` and `no foo` to not be symmetrical?

Of course, having `no foo` not turn off all foos is also insane.

That is why I don’t think `use foo` can sanely be made to mean
anything other than `use foo 'all'`.

Now for warnings there is a problem with that. Any state of things,
including the current one, is suboptimal, so the question is which
kind of pain we prefer.

But for strictures it would really be a self-inflicted problem. Why
don’t we just introduce new “strictures” as completely separate new
pragmata? If uncontroversial as defaults, they can eventually be added
to the set of pragmata that `use 5.x` turns on by default, for some x.
(And turned off by a corresponding `no 5.x` so there is symmetry.)
That way, adding them as separate pragmata does not lead to an ever
mounting pile of boilerplate, which is the only reason you would want
to add them to default set of things enabled by some existing `use X`.
I really see no appeal in adding new strictures in strict.pm.

I will concede that if `use strict;` becomes `use strict 'default'` and
the `default` category NEVER changes, and instead the default enabled
set of strictures expands by way of `use 5.x` enabling an increasingly
longer specific list of strictures over time, then I could live with
that OK… if not happily.

Otherwise we’ll end up adding version bundles to strict.pm as well, and
how many pragmata does that have to happen to before we realise it’s
stupid to include version policy capability in each interface separately
instead of leaving it to the central one we already have? (`use 5.x`)

(We have it in features.pm separately from `use 5.x` already, so that’s
a goner, and we probably can’t avoid adding it to warnings.pm as well.
Although maybe we can use the same approach there.)

If that doesn’t seem silly to you, consider whether a use case exists:
how much sense does it make to say “give me just the strictures from
5.36 – I don’t want any of its features (i.e. leave features at 5.12
level, implicitly), but give me all of the strictures from 5.36”? Who
is that for?

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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