-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
try without catch not documented #9320
Comments
Should probably return a |
Oops. I must have intended to return |
I was going to say that nothing seems like the consistent thing to return here. I don't recall the timeline here but it's possible that you implemented try before we had nothing. |
The current behavior is used, e.g., in RandomMatrices.jl, to test for the ability to import another package. Cc: @jiahao |
@kmsquire I think the issue here is a little different. In my code I wrote |
Returning |
@jiahao, I read that code and don't know how I missed that! Sorry for the noise. |
It occurs to me that we should add a way to document keywords like |
It turns out a few packages relied on this behaviour, e.g. JSON: |
Yes, this should definitely not be backported since it is breaking. |
`try/catch` no longer returns `false` when no `catch` block is defined and an exception is thrown. Ref: JuliaLang/julia#9320
I think I wrote that code, so that probably should have been my example On Sunday, December 14, 2014, Jeff Bezanson [email protected]
|
Oh right, the behavior changed here. Still worth documenting 0.3's behavior on release-0.3. Would doing |
There were no objections so I backported the modified version (returns |
While reviewing #9316, I learned that
try
...end
does not require acatch
orfinally
. But I can't find this construct documented in the manual section about exception handling. Did I miss something, or do we need to describe it in the manual? The semantics are surprising for programmers coming from a C++ background, so I think it deserves notice.The semantics seem to be that
try
exprend
returns the value of expr, unless an exception occurs, in which case it returnsfalse
.The text was updated successfully, but these errors were encountered: