On 2013-11-20, at 6:24, Patrick Walton <pcwal...@mozilla.com> wrote:

> On 11/19/13 7:43 PM, Tommi wrote:
>> I like how your argument nudges this whole discussion a few inches to
>> the left. Now we see that disallowing auto-borrowing from regular
>> function arguments doesn't buy us anything unless we also disallow it
>> from the target of method invocation syntax (dot notation). And
>> that's obviously assuming the upcoming UFCS feature. I doubt that
>> anyone would like to be writing (&*foo).call_method() all day long.
> 
> Magic in one part of the language isn't equivalent to magic everywhere in the 
> language. The dot operator is already magical in several ways: it autoderefs 
> for fields and searches through all traits in scope. This proposal would 
> confine the magic to that operator and that operator alone, preventing it 
> from leaking out into other parts of the language.
> 
> Patrick
> 

Yeah, my claim that it "doesn't buy us anything" stemmed from a misconception 
that arg.foo() could move arg, given let arg: ~A; and fn foo(x: ~A) {...}. I 
had already forgotten that Rust UFCS was specified differently from D's. To 
anyone not following, in D it would be a simple re-write to foo(arg) and, in 
Rust, to foo(&arg).
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to