I agree, seems only consistent that try without a catch should catch nothing.
I think you are right that this is deliberate, but I also think that making catch and finally orthogonal to each other should trump such case by case optimizations. It would allow a simpler mental model of the language. If you want the current behavior of
try end
you can use
try catch end
and I think there is something to be said for the explicitness that comes with only catching exceptions when there is a catch keyword involved.
I don't see how ignore in your list below is different from catching an exception and ignoring it. If you merge those two, your options reduce down to four, which map naturally to the four combinations of using our not using catch and finally respectively.
I think you are right that this is deliberate, but I also think that making catch and finally orthogonal to each other should trump such case by case optimizations. It would allow a simpler mental model of the language. If you want the current behavior of
try end
you can use
try catch end
and I think there is something to be said for the explicitness that comes with only catching exceptions when there is a catch keyword involved.
I don't see how ignore in your list below is different from catching an exception and ignoring it. If you merge those two, your options reduce down to four, which map naturally to the four combinations of using our not using catch and finally respectively.
elextr, in case you didn't see my comment on the pull request, I am quoting it hereelextr, I am still purplexed by this comment
note the value nothing can be tested so you can tell if the block exited by exception rather than returning its last expression
julia> nothing == try println("hello") end
hello
true
If developers start using return of nothing to detect having got an exception, that is bad as well. In the above example, there is perfectly valid non-erroring block and it returns nothing (because println returns nothing)
IMHO, we should be simply saying 'it returns the last expression executed' (just like any other block) - that is how I have worded it.