Re:Differences Between Perl 5 and Perl 6
by kylebgorman on Wednesday October 07, 2015 @11:24AM
(#10346550)
From this document, the chance that a perl 5 script is syntactically valid (but semantically different) perl 6 is awfully low. Now if the errors that arose said that you might be trying to execute perl 5 as perl 6, that'd be cool ;)
[ Parent
| on HN ]
Re:Differences Between Perl 5 and Perl 6
by donaldihunter on Wednesday October 07, 2015 @11:58AM
(#10346764)
There are numerous error messages that highlight perl 5 isms
e.g.
> say $#array;
===SORRY!=== Error while compiling <unknown file>
Unsupported use of $#variable; in Perl 6 please use @variable.end
and package foo;
===SORRY!=== Error while compiling <unknown file>
This appears to be Perl 5 code. If you intended it to be Perl 6 code, please use a Perl 6 style declaration like "unit package Foo;" or "unit module Foo;", or use the block form instead of the semicolon form.
Re:Differences Between Perl 5 and Perl 6
by amyjess on Wednesday October 07, 2015 @12:31PM
(#10346986)
Yes, these suggestions are among my favorite things about Rakudo.
There are a lot more, too. Another example:
> 1 == 1 ? "sane" : "insane"
===SORRY!=== Error while compiling <unknown file>
Unsupported use of ? and : for the ternary conditional operator; in Perl 6 please use ?? and !!
at <unknown file>:1
Or: > loop(my $i = 0; $i < 10; $i++) { say $i }
===SORRY!===
Word 'loop' interpreted as 'loop()' function call; please use whitespace around the parens
at <unknown file>:1
Easily the nicest error reporting I've seen in a compiler.