develooper Front page | perl.perl6.users | Postings from October 2019

What is a LoweredAwayLexical?

Thread Next
From:
Kevin Pye
Date:
October 22, 2019 22:37
Subject:
What is a LoweredAwayLexical?
Message ID:
CAG31JugL9zj3VZ91w_uQTg=ZM2antQU2O79bzdpgeihO1_c7mA@mail.gmail.com
Yesterday I created a new when clause in an existing working program, which
worked fine, but today when I came to exercise another previously working
when clause it was broken.

The golfed version...

my $a = 41;

given 6 {
    when 5 {
        my $a;
    }
    when 6 {
        say $a + 1;
    }
}

When run with various version of rakudo (at least on 2019.07.1 and current
HEAD) this produces

Use of uninitialized value of type Rakudo::Internals::LoweredAwayLexical in
numeric context

Is this expected? If nothing else, the error message is decidedly LTA.

I fixed it in my case by removing the unnecessary redeclaration of $a in
the when clause, but there might be times when that is incorrect.

(And on a side note, are there plans to move this mailing list to
raku-users@somewhere? There's nothing about it in the path to raku
document.)

Kevin.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About