Le 25/07/2013 01:56, Graydon Hoare a écrit :
for <pattern> in <expr> { ... }
Yes please.
- The 'do' form starts to look a little lonely / incongruous. We use
it presently for passing-in-a-closure when a function takes an
optional value, such as:
do hashmap.find_or_insert_with(k) {
def()
}
Given we're discussing macro-izing the other main use of 'do' to
generate an owning thunk Trait object, It's not entirely clear to
me that this pattern alone warrants keeping 'do'.
Aren’t there other uses of 'do'?
do std::task::spawn {
// ...
}
--
Simon Sapin
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev