The fact that we use “failure” (and
fail!) to refer to our unwinding mechanism often makes it awkward to talk about other kinds of failure. For example, for a function returning a
Result, you cannot talk about the operation “failing” without risking ambiguity. You instead have to say something more cumbersome like “the
Err case” or "when the operation produces an
The terminology is especially problematic as we move away from task failure and toward
Result, since you need to talk about the success/failure of the latter much more often than the former.
A strawman proposal: since task failure entails unwinding (and is essentially exception handling with limited catch points), call it “throwing”, with macro
throw!. Then operations like the current
recv_opt could instead be labeled
The main downside of using “throw”, of course, is that it suggests we have full-blown exception handling. I’d love to hear additional ideas.