Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Perl6 (MoarVM / Rakudo) warn about all missing semicolons?

Tags:

raku

In Perl 5, it's best to use

use strict;
use warnings;

to ask the compiler to complain about missing semicolons, undeclared variables, etc.

I have been informed by citizens of the Perl community here on SO that Perl 6 uses strict by default, and this seems after testing to be the case.

Semicolons aren't required for the last statement in a block, but if I extend the block later, I'll be chagrinned when my code doesn't work because it's the same block (and also I want semicolons everywhere because it's, like, consistent and stuff).

My assumption is that Perl 6 doesn't even look at semicolons for the last statement in a block, but I'm still curious: is there a way to make it stricter yet?

like image 426
cat Avatar asked Sep 26 '22 13:09

cat


1 Answers

Rather than enforce the extra semi-colon, Rakudo does try to give you a good error/hint if you do add to your block and forget to separate statements.

Typically I get "Two terms in a row across lines (missing semicolon or comma?)" when this happens.

like image 108
awwaiid Avatar answered Nov 15 '22 08:11

awwaiid