Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Raku dropping exceptions when a loop variable is used?

Tags:

exception

raku

I really can't find another explanation for this:

for <a b> -> $foo {
    spurt "a/b", "bar";
}
say "Gotcha";
for <a b>  {
    spurt "a/b", "bar";
}

This prints "Gotcha" and then fails. I get that the last value in a loop is returned, and that if nothing is done with it it's in sink context, but what kind of change brings declaring a variable to it? It's still a Block, far as I can tell.

like image 548
jjmerelo Avatar asked Jul 03 '26 22:07

jjmerelo


1 Answers

Using Rakudo 2022.07

returns:

Gotcha
Failed to open file /Users/admin/a/b: No such file or directory
  in block <unit> at - line 6
like image 98
jubilatious1 Avatar answered Jul 09 '26 05:07

jubilatious1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!