Re: [rust-dev] Exceptions without exceptions (was Re: Writing cross-platform low-level code)

2011-11-16 Thread Niko Matsakis
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,

Re: [rust-dev] Exceptions without exceptions (was Re: Writing cross-platform low-level code)

2011-11-16 Thread Brian Anderson
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

Re: [rust-dev] Exceptions without exceptions (was Re: Writing cross-platform low-level code)

2011-11-16 Thread Niko Matsakis
On Nov 16, 2011, at 11:07 AM, Brian Anderson wrote: I had thought to redefine result as resultT { ok(T); err(any); } once that was possible, but I do think maybe creating an exn type as David proposed could be better. I am somewhat indifferent as to the precise type of exceptions, so long