5 ms·
There are numerous error messages that highlight perl 5 isms e.g. > say $#array; ===SORRY!=== Error while compiling <unknown file> Unsupported use of $#
by donaldihunter 11y ago
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.
- amyjess 11y agoYes, 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.