-
-
Couldn't load subscription status.
- Fork 5.7k
Add noscope macro to make try blocks evaluate in the local scope #39217
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
Conversation
131a088 to
1102669
Compare
| 1 | ||
| ``` | ||
| """ | ||
| macro noscope(ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
| macro noscope(ex) | |
| macro noscope360(ex) |
?
| Expr(:trycatch, | ||
| :($(esc(ex.args[1]))), | ||
| quote | ||
| begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think this and all the finally and catch blocks should still be scoped
| begin | |
| let |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
From triage:
|
|
With #48434 being open and it being unlikely that I'd take this forward, I'll close this |
It could be generally useful to evaluate a
tryin the local scope, as is the case in #39138Based on a suggestion by @vtjnash this adds
@noscopefor makingtryblocks evaluate in the local scopeIf this is supported, there may be a better place for the code and tests to sit?