On 9/7/11 10:54 AM, Graydon Hoare wrote:
On 11-09-07 07:18 AM, Marijn Haverbeke wrote:
But if you ignore the actual binary calling convention, you can think
of this proposal as passing everything by reference. Immediates will
in fact be passed by value, since this is more efficient, but the
difference is not observable in regular, safe code.
I'm mostly ok with this change, subject to some caveats and preferences:
The key phrase in your message is "safe code". Unsafe code can observe
it. I want the addr-vs-copy distinction clearly spelled out in either:
- The language semantics, in the manual.
or
- Something discoverable at compile time and subject to conditional
compilation.
A mystery-heuristic that programmers can't depend on is much less
attractive. Users are going to write unsafe code that occasionally
observes the distinction. I don't want to be hiding this.
This makes a lot of sense. +1.
Making copy an explicit operator instead of an argument mode makes it
easy to tell where the copy is happening at the call site, which is nice
(unless the callee is doing the copying, which seems rare).
Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev