hankache / rakuguide

The Raku Guide
https://raku.guide
Creative Commons Attribution Share Alike 4.0 International
193 stars 67 forks source link

binding code snippet example not working #168

Open sztanyi opened 6 years ago

sztanyi commented 6 years ago

Following code in section 3.7. Assignment vs. Binding seems not working my $a; my $b; $b := $a; $a = 7; say $b; $b = 8; say $a;

i got the following error message: `

my $a (Any) my $b (Any) $b := $a; ===SORRY!=== Error while compiling: Cannot use bind operator with this left-hand side ------> $b := $a;`

zoffixznet commented 6 years ago

Thanks. This looks to be a REPL bug. I filed it in Rakudo as https://github.com/rakudo/rakudo/issues/1565

The code from the example should work fine if you save it into a file and run perl6 the-file.p6