in reply to Re: Announcing Perl 7
in thread Announcing Perl 7
Details in this slack discussion https://perlfoundation.slack.com/archives/C014K7XQ5HA/p1593097091360400
LanX Heute um 16:58 Uhr
so let me summerize what I understood about planed backwards- compatibility for CPAN and Perl7
* if a module has "use 5.X" old features like sub (PROTOTYPE) { BLOCK } will stay enabled
* if a CPAN -Modules has no "use 5.X" then it will be assumed by the CPAN-Installer to be 5ish, a Flag will be set and the old features stay enabled
* it has to "use 7.X" to indicate that new features are enabled
not sure how the second point can be achieved without statically parsing the code, since use Statements are executed at compiletime
Did I get it right?
=== Update
One example of code without explicit Perl-Version is List::Util , (which is also CORE but nevertheless also on CPAN) (bearbeitet)
16 Antworten
LanX vor 2 Stunden
Please reply in thread ... (bearbeitet)
autarch vor 2 Stunden
No, absent any indication perl 7 will run code in "7 mode" (for lack of a better term), which includes strict & warnings by default
autarch vor 2 Stunden
and other features
LanX vor 2 Stunden
yeah but how do you plan to maintain code on CPAN which is supposed to run on both major versions?
5 has no "use oldPrototypes"
e.g, take a look at List::Util (bearbeitet)
autarch vor 2 Stunden
no idea, honestly
autarch vor 2 Stunden
I'm just answering based on what I got from the presentation
LanX vor 2 Stunden
I think hat's a crucial question and I just asked in the BOF, and that's how I understood Todd.
But i prefer to ask again in a written form ...
regarding CORE modules, I think I saw Paul Evans yesterday mentioning that he doesn't know if he wants to maintain 2 versions of List::Util
Dakkar vor 2 Stunden
a thing that Todd said: use compat::perl5 can be trivially written to work in perl5 (he has written it already); so, if a cpan maintainer has a module that won't "just work" in 7, they can add use compat::perl5; to it, add that module to the dependencies, and be done
:+1:
1
Dakkar vor 2 Stunden
https://gist.github.com/toddr/0c280d3a4f5951776cd0d1e6d49dba11
LanX vor 2 Stunden
true ... but he also said that the installer would introduce it automatically for other modules (like unmaintained ones) ... right?
Dakkar vor 2 Stunden
yes, which wouldn't even be that hard (add that line after every package declaration, or at the top of the file, if the META.yaml doesn't say the distribution requires perl => '>= 7.0'
:+1:
1
Dakkar vor 2 Stunden
(disclaimer: I'm not a core dev, and I'm handwaving a lot)
LanX vor 2 Stunden
OK ... that sounds reasonable
Dakkar vor 2 Stunden
I'm sure there's tons of weird cases where it won't Just Work™, but this covers a lot of ground
LanX vor 2 Stunden
Yeah ... sorry for insisting ... but before talking about more feature requests we have to get this right
:+1:
1
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|