Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
So the concept seems to be that a use compat::perl5; can be used to allow backwards compatibilty.

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


In reply to Re^2: Announcing Perl 7 by LanX
in thread Announcing Perl 7 by marto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found