develooper Front page | perl.perl5.porters | Postings from July 2020

Re: Announcing Perl 7

Thread Previous | Thread Next
From:
demerphq
Date:
July 3, 2020 17:48
Subject:
Re: Announcing Perl 7
Message ID:
CANgJU+U2hL_E8WK5R4pxRso7nDM2wFU+kKfYFBrbPHsQAdQYJw@mail.gmail.com
On Fri, 26 Jun 2020 at 22:54, Craig A. Berry <craig.a.berry@gmail.com> wrote:
>
> On Fri, Jun 26, 2020 at 1:25 PM demerphq <demerphq@gmail.com> wrote:
> >
> > On Fri, 26 Jun 2020 at 18:03, Dave Mitchell <davem@iabyn.com> wrote:
> > > So for example,  running a plain perl script using a perl7 interpreter is
> > > as if the following lines had been injected at the top of the script:
> > >
> > >     use warnings;
> > >     use strict;
> > >     use feature 'signatures';
> > >     no feature 'indirect';
> > >     ... etc ...
> > >
> > > is that the same as your understanding?
> >
> > Depends on your definition of "as if".
> >
> > If it means "exactly the same as", then no, that isnt my expectation.
> >
> > If it means "produces the same practical outcome for the developer" then yes.
> >
> > Meaning that if my understanding of what "use strict;" will imply is
> > correct then we would probably not make the v7 semantics actually
> > trigger strict.pm, the latter would be used only in legacy code.
>
> This is super confusing to me.  I think I hear you saying that 7.0.0
> will have strictness enforced by default, albeit not via strict.pm.
> OK.  But then you also said you have the impression that actually
> putting "use strict;" at the top of your code will disable the v7
> feature bundle and be equivalent to the backward compatibility pragma
> but with strict.pm loaded.  Is that really what you are saying?  That
> means everyone who has ever followed the advice to enable strictness
> will have to remove the explicit "use strict;" from their code in
> order to get all the new on-by-default features. That does not sound
> like the principle of least surprise to me; the v7 semantics would be
> invisible to well-maintained software that follows coding standards,
> and a big, incompatible wallop to everything else.  Hopefully I'm just
> missing a clue here somewhere and have not understood what is really
> being proposed.

Sorry, I got run over by a bus at work metaphorically at an
inconvenient time for this thread and there are so many posts I have
no idea what is going on properly so I dont know if this has already
been responded to, or if im even right, but what I understood was that
if you use strict inside of the scope of a use v7 (or later) then the
use strict would be a no-op effectively, and not change what version
is expected.

---
package Foo; # parsed as v-latest but it doesn't matter.
use v7; # give me well defined semantics
use strict; # no op
---

vs:

---
package Foo; # parsed as v-latest but it doesn't  matter.
use strict; # implied 'use v5;'
---

Does that make more sense? To me that means most code would not break.

cheers,
Yves




-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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