On Fri, Oct 19, 2012 at 4:48 PM, Graydon Hoare <gray...@mozilla.com> wrote:
>
> 3. "Trap/in", a.k.a. "the system I like the look of best": this is the
> version Patrick suggested yesterday. It sets up the handlers in the head
> of a do-block and then invokes the protected code. It's order-inverted
> from protect/handle -- the handlers come before the protected code --
> but it still reads ok to my eyes, and seems to play nicely with our
> existing syntax:
>
>   do OutOfKittens.trap(|t| UseAardvarksInstead).in {
>       do_some_stuff();
>       that_might_raise();
>       out_of_kittens();
>   }
>
> Opinions? Clarifying questions?


I like 3 the best, and 2 not at all unless we can somehow gensym and
hide the guard value. Otherwise I expect I'd forget to store it in a
variables and not actually have my trap enabled.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to