-
-
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
Clarification on try/catch/finally blocks and a few more examples #10776
Conversation
Thanks, I didn't know what. That said, although I removed that phrase from the original example, the return value of nothing is documented below (in a separate section on return values, after the finally is explained, with many examples). I have tried to use julia> nothing == try end julia> nothing == begin end I will resubmit tomorrow. Thanks for your time |
elextr, I am still purplexed by this comment
julia> nothing == try println("hello") end If developers start using return of IMHO, we should be simply saying 'it returns the last expression executed' (just like any other block) - that is how I have worded it. |
Of course if the normal return from the block is also If there is an exception the value of the try block is You are not meant to use the But if you are ignoring exceptions and the normal value of the try block is something else and you use that value then you probably need to check, because further computations using that value may barf with |
thanks. I closed only because I thought I couldn't state my point with elextr. I didn't know Julia enough to continue to make the case, so I left it. |
@harikb I'm not sure what is still open, you have documented the fact that the |
Since this PR, we renamed the file (from rst to md format). Is it something we should revive? |
I have a few edits for the try/catch/finally blocks. Related discussion on this topic in julia-users mailing is here https://groups.google.com/d/msg/julia-users/Kqn6gNIwD5o/g9xiMmOKAoIJ
I understand this is a fairly extensive edit than what is discussed in the thread, but I think it clarifies a lot of things. If you want me to remove any edits, please let me know and I will undo them and resubmit.
All examples are quoted from real julia session. I have done "make html" and verified it appears ok. However, I have not been successful running doctest in general (even before this change) because of the issue mentioned in this post https://groups.google.com/d/msg/julia-users/n0OjsGJpMRc/XOdv7Uqtu9oJ