On 11/30/13 12:04 PM, Oren Ben-Kiki wrote:
Just to mention in passing - there's a related principle that converting
a block to a closure shouldn't change its semantics. This obviously
doesn't fully work because of return/break/continue; that said, if a
block without such flow control constructs is wrapped into a closure,
you'd expect it to just work. It doesn't, because to work it would have
to be a once-called-stack-allocated lambda, which Rust doesn't have (I
don't get the reason for that either :-)

If you decompose into a lambda plus the tupled set of upvars which it's moving out of, then this respects TCP.

Patrick

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to