Help for this page

Select Code to Download


  1. or download this
    my $foo := 42; # declares $foo at compile time, binds it to immutable 
    +42 at run-time
    BEGIN say $foo; # (Any)
    $foo = 99; # Cannot assign to an immutable value
    
  2. or download this
    my @foo := (42, $);
    @foo[1] = 99;
    say @foo; # (42 99)
    @foo[0] = 99; # Cannot modify an immutable Int