I hereby claim:
- I am spakin on github.
- I am pakin (https://keybase.io/pakin) on keybase.
- I have a public key whose fingerprint is 888E 96CC B15F 8E47 6D4A 1F45 6F7F 752C CCA3 F9F5
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Although in Error Handling — Problem Overview, Russ Cox does a great job motivating the need for lighter-weight error handling, I have a few concerns with the catch
and handle
mechanisms proposed for Go2. I most dislike the fact that only one handler can be active at any point in the code. I largely disapprove of recoverable errors not being supported. And I'm not particularly fond of check
being hard-wired to work only with type error
.
In my counter-proposal, I call for a single new keyword, returnfrom
:
ReturnFromStmt = "returnfrom" Label [ExpressionList] .
The semantics is that returnfrom
behaves like a return
appearing in the same scope as a given label. It's therefore a bit like a goto
but supports the handler nesting that Cox's article calls out as important for proper cleanup.