Re: [rust-dev] Move as a unary operator, or, alternatively, as an implicit optimization

2011-09-17 Thread Patrick Walton
On 9/17/11 11:59 AM, Marijn Haverbeke wrote: - The implicit, clever approach: Notice that the only situation where you want to do this is when using a local variable (you can't move out of data structures) for the last time, and simply make the compiler optimize the last use of a variable into a

Re: [rust-dev] Move as a unary operator, or, alternatively, as an implicit optimization

2011-09-17 Thread Marijn Haverbeke
If an explicit copy operator is needed for uniques, then this isn't even ambiguous, is it? So I guess you're planning to make vectors and strings (and anything containing them) also explicit-copy-only? In that case, I guess we're fine. (Though, with strings, I expect this to cause some pain.)

Re: [rust-dev] Precedent for our aliases and unique types

2011-09-17 Thread Marijn Haverbeke
I'm less concerned about blocks than I am about @fn (which we still have AFAIK) and objects. To recap, immutably rooted references (which is most of them) are safe as long as their root isn't touched. So closures and objects don't cause a problem there. Mutably rooted references are the

Re: [rust-dev] The lowdown on return-by-reference

2011-09-17 Thread Graydon Hoare
On 16/09/2011 2:10 PM, Marijn Haverbeke wrote: The original solution proposed was to pass the accessor a block and pass the value to that block by reference. This would cause blocks to spring up everywhere (with all the indentation and noise that comes with it) and be extremely un-composable. A