HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by twir | Hacker News Reader
Parent
Full thread
twir
·
Wow, never knew one could do that.
View on HN
nradov
·
You can't do that. It would require a language change, to make try/catch blocks expressions.
twir
·
Heh, I didn't think so. ;)
eldenbishop
·
You can sort of do this in Groovy.
def val = {try { 1 } catch(ex) { 2 }}.call() assert(1 == val)
Reply on news.ycombinator.com