Skip to content

Some Perl6 programs won't compile #61

Open
@jarble

Description

@jarble

I tried to run this program with the Perl6 compiler, but it won't compile:


# this example is from Rosetta Code:
# https://rosettacode.org/wiki/99_Bottles_of_Beer#Perl_6

my $b = 99;
 
repeat while --$b {
    say "{b $b} on the wall";
    say "{b $b}";
    say "Take one down, pass it around";
    say "{b $b-1} on the wall";
    say "";
}
 
sub b($b) {
    "$b bottle{'s' if $b != 1} of beer";
}

This is the error from the compiler log:

Compiling.
Emitting javascript.
Finished compilation unit at pos 320 of 320
Error:
{}
Compilation aborted.

Why does this program not compile?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions