Re:Show HN: Try/Catch/Finally experiment in Go
by baq on Thursday August 14, 2014 @03:43PM
(#8179440)
limited usefulness - can't return from the trying function. incidentally, try/finally and returns are what gives people funny facial expressions.
[ Parent
| on HN ]
Re:Show HN: Try/Catch/Finally experiment in Go
by manucorporat on Thursday August 14, 2014 @04:33PM
(#8179703)
yeah! I agree, it's just an experiment. Anyway, you could use the named return values to have a similar behaviour.
func hello() (a int) {
try.This(func() {
a = couldPanic()
}).Catch(_ try.E) {
a = 0
})
}