Basically, the only problem that I see is implicity. If I want to rethrow or continue, I want to make it explicit,
Do you mean that you want it to always be an error when control reaches the end of the onerror clause? I.e. the user should always specify either rethrow or continue before that?
Something like "dismiss" and "escalate" would be more clear, IMHO.
There's some merit in that. The language shouldn't invite to doing the mistake I envisioned in an earlier example (10773358), so I agree the statement for continuing shouldn't be "break", at least.
Regarding "escalate", it's unnecessary. As Per pointed out, you can just as well write "throw(err)" for that.
If we have a special operator to handle error, the keywords must be special as well (or we have a problem - how to rethrow explicitly from inside of "for" loop, using "break" or "continue"?).
Then labels are used, just like when breaking or continuing any switch/for/while/do block that isn't the innermost one. You'd get the same problem with nested onerror clauses anyway, regardless of the chosen keywords.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-10-02 18:43: Subject: Re: throw or return
On Thu, Oct 02, 2003 at 06:35:02PM +0200, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
So when you write the code that prints the message you also add a "break" afterwards to signify that the problem has been handled. What's the problem with that?
Basically, the only problem that I see is implicity. If I want to rethrow or continue, I want to make it explicit, and preferably without "continue" or "break" - just to make sure that those keywords won't be misinterpreted in case when someone forgot {} or so around "for", "while" or "switch".
Something like "dismiss" and "escalate" would be more clear, IMHO.
If we have a special operator to handle error, the keywords must be special as well (or we have a problem - how to rethrow explicitly from inside of "for" loop, using "break" or "continue"?).
Regards, /Al
/ Brevbäraren