2014-03-24 1:08 GMT+09:00 Léo Testard <leo.test...@gmail.com>:
> On the other hand, I never felt gotos missing when writing FSM simulation
> code, but we do have a very nice syntax for jumping out of nested loops :
>
> g: for i in foo.iter() {
>     // ...
>     h: loop {
>         if foo { break g; }
>         continue h;
>     }
> }
>
> This syntax only allows to jump at the beginning of a lexical block, and
> only to an larger scope, thus not infriging any static lexical rule.

To be exact, it is `'g: ...` and `break 'g;` respectively. Its
resemblance with the lifetime syntax is no coincidence.

-- 
-- Kang Seonghoon | Software Engineer, iPlateia Inc. | http://mearie.org/
-- Opinions expressed in this email do not necessarily represent the
views of my employer.
--
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to