Ulrik Mikaelsson wrote:
Tomasz Sowiñski Wrote:

I like it. Although it's only sugar you're right -- it helps reading a bit. But I would 
allow (or even require) "try" before a block of code:

if (condition) try {
    ...
} catch (Exception ex) {
    ...
}
Agreed. And while the use-case for if-statements may be rare, I can see a few 
cases in for-loops where it actually makes a little sense, but then it's better 
to be explicit about it;

foreach (item; collection) try {
  process(item);
} catch (StopException e) {
  break;
}

As Tomaz pointed out, this already works for statements (if, while, for, foreach, with, synchronized, etc.).

Reply via email to