DanielXMoore / Civet

A TypeScript superset that favors more types and less typing

Home Page:https://civet.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"try coalescing" / catch operator

bbrk24 opened this issue · comments

Some operator shorthand for try/catch:

x = foo() op bar()
// vvv
try {
  x = foo()
} catch {
  x = bar()
}

Suggested spellings for the operator (from Discord) include catch (with implicit try) and !! (to mirror ??). Precedence should be lower than function application.