forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add try/catch/else (JuliaLang#42211)
This PR allows the use of `else` inside try-blocks, which is only taken if no exception was caught inside `try`. It is still combinable with `finally` as well. If an error is thrown inside the `else` block, the current semantics are that the error does not get caught and is thrown like normal, but the `finally` block is still run afterwards. This seemed like the most sensible option to me. I am not very confident about the implementation of linearization for `trycatchelse` here, so I would appreciate it if @JeffBezanson could give this a thorough review, so that I don't miss any edge cases. I thought we had an issue for this already, but I couldn't find anything. `else` might also not be the best keyword here, so maybe we can come up with something clearer. But it of course has the advantage that it is already a Julia keyword, so we don't need to add a new one. Co-authored-by: Jeff Bezanson <jeff.bezanson@gmail.com>
- Loading branch information
1 parent
519e31e
commit 032f350
Showing
7 changed files
with
146 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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