On 7/24/13 5:56 PM, Graydon Hoare wrote:
Hi,
We had some discussion recently about reforming the for-loop syntax
since we'll be switching it to external iterators and it's a bit
deceptive to the user to be writing a lambda-pattern there. Many people
have suggested we use a simple and familiar:
for <pattern> in <expr> { ... }
+1
So I'm wondering how this looks for people:
<expr> in <expr>
The more I think about this, the more I like it. "new" is not great as
we're already using it everywhere for constructors. And it's all about
*placement*, as you said: you're placing the value *in* another location.
let expr = Expr::new(foo, bar, baz) in Gc;
let my_dom_node = Element::new() in JsHeap;
let my_flow_node = BlockFlow::new() in FlowArena;
The only thing I might worry about is that it conflicts with Python's
and JS's use of "in", but that isn't a showstopper to me.
Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev