On 11/20/2013 02:51 PM, Bill Myers wrote:
Have you considered making deref the default instead and requiring moves to use an 
explicit "move" keyword?

Basically, from this hypothetical syntax to current one:
- x => &x
- mut x => &mut x
- move x => x

One could even make the & implicit in parameter types in function declarations unless the 
"move" keyword is used, so we would have (new => old syntax):
- fn(self, ...) => fn(&self, ...)
- fn(mut self, ...) => fn(&mut self, ...)
- fn(move self, ...) => fn(self, ...)

I like this proposal, because afaik it matches the common use case.
Also, it would make things easier to learn, understand, and use, for people not used to move semantics (even less to it as default / implicit case). I do struggle with move; making it explicit would help (also when reading it other people's code).

Denis
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to