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

Re^2: Perl 6 critique is a good thing

by Ven'Tatsu (Deacon)
on Oct 18, 2004 at 15:31 UTC ( [id://400175]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl 6 critique is a good thing
in thread Perl 6 critique is a good thing

I'm not sure why they chose not to include a pragma to switch to Perl5 parsing, but Perl6 syntax is supposed to be mutable, so you could see it happen.
That said you will be able to do
use Old::Perl5::Style::Module; #I'm assuming this exports old_perl5_st +yle_code by default old_perl5_style_code();

Replies are listed 'Best First'.
Re^3: Perl 6 critique is a good thing
by DrHyde (Prior) on Oct 18, 2004 at 16:45 UTC
    This was discussed in the thread spawned by node "Ensuring forward compatibility". In summary, the answer is that if you mention the keyword 'package' then the interpreter knows you're talking in perl5.

    So consider package main; to be equivalent to use perl5;. And, of course, all your existing modules already have a package so will Just Work <cough><splutter>.

      package main; isn't quite equivalent. The use perl5; statement could be placed inside a local block -- that would aid developers moving from Perl5 to Perl6, as they could do complicated things the "old way" until they can figure out the Perl6 equivalent.

      I think that's well in line with "make the easy things easy and the hard things possible".

      radiantmatrix
      require General::Disclaimer;
      "Users are evil. All users are evil. Do not trust them. Perl specifically offers the -T switch because it knows users are evil." - japhy

        The use perl5; statement could be placed inside a local block -- that would aid developers moving from Perl5 to Perl6, as they could do complicated things the "old way" until they can figure out the Perl6 equivalent.

        I sent a message to perl6-internals a while ago, asking if it would be possible to have multiple versions of the same language loaded. This will not be easy (much to my surprise and sadness, as something like only.pm for the language itself would certainly help with ensuring that modules work as intended), according to Elian. His main argument is that any bugs found will more likely be Parrot bugs than $language bugs. I don't know if has a point, but he's the Parrot man, so he probably knows best.

        However, Perl 5 is hopefully not another version of Perl in this way. We'll have Ponie and Perl, and I assume that for sanity's sake, they will live as separate languages in Parrot. I expect that there WILL be something like Inline to enable having code of several languages in the same file. And because that will probably initially support whatever Parrot supports, that means you can use Ponie code in it.

        I think Parrot will make having something like Inline easy, at least for languages that run on Parrot. I think inline 'Ponie', <<'EOP' is an acceptable alternative to { use 5; ... }. If not, feel free to fiddle with Perl 6's parser, as it will make trying this easy enough. Good luck parsing Perl, though!

        Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Re^3: Perl 6 critique is a good thing
by revdiablo (Prior) on Oct 18, 2004 at 16:58 UTC
    I'm not sure why they chose not to include a pragma to switch to Perl5 parsing

    A pragma isn't necessary. The heuristic they use is extremely simple. Perl 6 does not have packages. If some code has a package statement in it, then it must be Perl 5.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://400175]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2024-04-23 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found