New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return in block does not return from sub that is parameterised with that block #5895
Comments
From @gfldexmy &block = { say 'returning from &block'; return }; # OUTPUT«enter returned-fromreturning from &blockAttempt to return outside of any Routine in block <unit> at <tmp> line 1» |
From @moritzHi, On 18.12.2016 15:35, Wenzel Peppmeyer (via RT) wrote:
I'm pretty sure that's not a bug; &return is supposed to be tied to the Cheers, -- |
The RT System itself - Status changed from 'new' to 'open' |
@moritz - Status changed from 'open' to 'rejected' |
From @zoffixznetOn Sun, 18 Dec 2016 08:44:31 -0800, moritz wrote:
Isn't this just throwing a CX::Return control exception and thus should work? How/when does the tying to the lexically outer Routine happen? Such method works for other control exceptions, like, CX::Last: my &block = { say 'returning from &block'; last }; # OUTPUT: |
Migrated from rt.perl.org#130371 (status was 'rejected')
Searchable as RT130371$
The text was updated successfully, but these errors were encountered: