However, it would be nice to still have current "catch" behavior, i.e. catch() and catch{} - those are useful sometimes (it may return an exception object, but avoids extra code and looks more clean).
I don't agree that it looks more clean when taking into account all the surrounding code that is necessary to use it correctly. Still, it should of course continue to exist, for compatibility's sake if nothing else. And if people continue to prefer it in some situations then it'd be silly to remove it.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-10-02 00:32: Subject: Re: throw or return
On Thu, Oct 02, 2003 at 12:20:02AM +0200, Mirar @ Pike developers forum wrote:
What happens if you return in the try, onerror or finally part?
In the "try" part - return is handled as usual (obviously - if it reached then everything is OK).
In the "onerror" and "finally" parts - stack unwinding and return as usual (unless this is impossible at all, but there are no reasons why it should not be possible - for normal, i.e. not internal compiler/interpreter errors).
However, it would be nice to still have current "catch" behavior, i.e. catch() and catch{} - those are useful sometimes (it may return an exception object, but avoids extra code and looks more clean).
Regards, /Al
/ Brevbäraren