elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Rename try/except to try/catch

Open xiaq opened this issue 3 years ago • 1 comments

While working on #1424 I realized that only Python calls the clause to catch exceptions except; it's catch in all other languages.

I feel catch is slightly better because it's a bit clearer what happens when it's omitted (which is still going to be legal in try { ... } finally { ... }): if there is no catch, the exception is not caught.

As with all breaking changes, this will be done in 3 steps:

  1. Elvish 0.18.0 will support both, while deprecating except.
  2. Elvish 0.19.0 will drop support for except.

xiaq avatar Mar 01 '22 13:03 xiaq

it's catch in all other languages.

That's also been my experience. While I love Python its use of except rather than catch has always slightly annoyed me. I appreciate the impetus for making that choice from among the reasonable keywords since it obviously maps "exception(s)" => "except". But you don't "except an exception" you "catch an exception". 😄

krader1961 avatar Mar 13 '22 02:03 krader1961

This is now done with the removal of support for except.

xiaq avatar Mar 15 '23 22:03 xiaq