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

Re: Announcing Perl 7

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
July 3, 2020 18:30
Subject:
Re: Announcing Perl 7
Message ID:
20200703193006.71a556c4@shy.leonerd.org.uk
On Fri, 3 Jul 2020 20:20:04 +0200
demerphq <demerphq@gmail.com> wrote:

> What you are actually saying is that "for now we will be in perl 5
> mode, and  some time in the future we will start out in "seek a use
> v$digit; statement mode, anything else will be an error".
> 
> I don't like that.
> 
> I want this:
> ---
> package Whatever;
> use v7;
> ---
> to not be an error. I don't want to have to write:
> 
> ---
> use v7;
> package Whatever;
> ---

OK that's fair. I guess it would probably be fine to accept "package"
before "use VERSION". There might be one or two other cases, but they
should be handled on a case-by-case basis. Maybe say no code with
runtime effects before a "use VERSION". I haven't fully thought this
one through yet I'll admit.

> I mean, what will this do to eval statements? Does every eval TEXT
> have to be prefixed with a 'use v7' or whatever?

Mmm... That's another exciting question I hadn't considered.

I think at this point there's sortof three separate containing
"contexts" in which we might find ourselves looking at some new perl
code in the parser, and wanting to have an idea of a version for it.

 * A newly loaded .pm file

 * The contents of a -e or -E commandline argument

 * A string given to eval()

While the idea of explicit "use VERSION" is attractive in the first
case, it doesn't really do much for the other two cases. Perhaps we may
have to have different rules for each case. I think already there's a
strong feeling that -e/-E arguments should remain in "no strict" mode,
because for little commandline one-liners nobody wants to have to "my"
everything. So already it's understandable that the rules might be
different in different places.

-- 
Paul "LeoNerd" Evans

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

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