Add noscope macro to make try blocks evaluate in the local scope#39217
Closed
IanButterworth wants to merge 1 commit intoJuliaLang:masterfrom
Closed
Add noscope macro to make try blocks evaluate in the local scope#39217IanButterworth wants to merge 1 commit intoJuliaLang:masterfrom
IanButterworth wants to merge 1 commit intoJuliaLang:masterfrom
Conversation
131a088 to
1102669
Compare
fredrikekre
reviewed
Jan 12, 2021
| 1 | ||
| ``` | ||
| """ | ||
| macro noscope(ex) |
Member
There was a problem hiding this comment.
Maybe
Suggested change
| macro noscope(ex) | |
| macro noscope360(ex) |
?
IanButterworth
commented
Jan 13, 2021
| Expr(:trycatch, | ||
| :($(esc(ex.args[1]))), | ||
| quote | ||
| begin |
Member
Author
There was a problem hiding this comment.
Actually, I think this and all the finally and catch blocks should still be scoped
Suggested change
| begin | |
| let |
Member
|
From triage:
|
This was referenced Aug 18, 2021
Member
Author
|
With #48434 being open and it being unlikely that I'd take this forward, I'll close this |
This comment was marked as off-topic.
This comment was marked as off-topic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?