Skip Menu |
Report information
Id: 131504
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [LTA] .&foo form differs from foo($_) when routine throws control exceptions
Download (untitled) / with headers
text/plain 835b
I assumed the .&foo form was just a nicer way of writing foo($_), however they differ in that the thrown control exception doesn't go far enough in .&foo form and it doesn't actually return from the routine with things like .&fail and .&return <Zoffix__> m: sub { 'foo'.&fail; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «foo␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤» <Zoffix__> m: sub { fail 'foo'; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «Failure␤» <Zoffix__> m: sub { return 'foo'; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «Str␤» <Zoffix__> m: sub { 'foo'.&return; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «Int␤»


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org