On 06/06/12 02:20, Patrick Walton wrote:
1. 2. 3. ...
These look very nice to me.
4. Add a new form, `do`, ...
I think that allowing an early exit with a break/continue from lambdas that use this special form is confusing, because "breaking" may or may-not actually resume the code that follows the do-call. The lambda might be put into a data structure for later execution, or, like in your spawn example, executed in a new task.
I would prefer that instead of having a special `do` form, all `|| expr` lambdas could have early returns using `ret`. This makes sense because lambdas are functions (but when used with a for-loop they are special). The other kind of rust functions (i.e. non-lambdas) can have early returns, so allowing `ret` in lambdas means that one is able to use the same early-exit style in lambdas as in fn-functions, which is symmetric and therefore nice.
Thanks Gareth _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
