upvote
Have a look at the eros crate for rust. It implements a convenient error set mechanism mostly without macros
reply
That looks almost exactly like what I've wanted from rust errors - thanks! Sadly I hadn't seen that before.
reply

    y = U64.from_str(b) ? InvalidSecond   
    # returns Err(InvalidSecond(BadNumStr))
Ooo, I like that syntax. Implicit wrapping, but it gives you a type you control so you can <do stuff> if needed.
reply
Isn't that how exceptions work, as the union of all possible defined exceptions?
reply
I differs that exceptions are hidden and you don't experience them until something happens so it's easier to forget to handle them (at least that is my experience). Here they are up front and visible and forces us to either handle or propagate them.
reply
No recovery / restarts though.
reply