News for hackers. Stuff that matters.
Re:Why Go Gets Exceptions Right by ori_b on Friday September 14, 2012 @11:06AM (#4521981)
You could implement something like lvalue pattern matching, if you wanted to.

Assuming you construct tagged unions like so:

    Valid 123
    Error "Error message"
You could pattern match on the left side of an assignment like so:

    Valid foo = dosomething()
    use(foo)
Which would extract the wrapped value into 'foo' if the union's tag was 'Valid', or aborted/panicked/did something else somewhat sane if the value didn't match.

There are no comments on this comment yet.