On 11/16/2011 10:58 AM, Niko Matsakis wrote:
I think this set of macros may be overkill.  The #do[] macro alone seems sufficient to me.  "Throw" is just "ret 
error()" and succeed is just "ret success()", after all, both of which are fairly clear and succinct.  
"Catch" is just "alt" with pattern matching.  As for the issues with the error types, that can be annoying, 
probably something like any will be the best.  In fact, I could imagine that a useful type alias might be

        type may_fail<T>  = std::result<T, any>

or perhaps

        type may_fail<T>  = std::result<T, str>


I had thought to redefine result as result<T> { ok(T); err(any); } once that was possible, but I do think maybe creating an exn type as David proposed could be better.

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to