I'm a little concerned that no other language I know of does this.
"Value types are copied, except when structural value types are passed
as a parameter to a function" seems like a more subtle rule than "value
types are always copied".
I don't really see this as doing *without* by-alias parameters per se;
it's just making the mode (copy vs. alias) of a parameter implicit,
chosen based on the type. While this is attractive from the perspective
of having the right defaults, it also makes the semantics of the code at
a glance more subtle.
I think I'd be more comfortable with adding an explicit sigil for copy
mode (* or =, say), and having the automatic default kick in if and only
if the sigil is left off. That way, the vast majority of the time,
programmers can leave off the sigils and get the right default, but if
the programmer needs explicit control the sigil can be supplied.
In any case, I'm in favor of changing |x : &T| to |&x : T|.
Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev