<div class="gmail_quote">On Mon, Sep 10, 2012 at 1:36 PM, Timon Gehr <span dir="ltr"><<a href="mailto:timon.gehr@gmx.ch" target="_blank">timon.gehr@gmx.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br></div>
Yes, Go uses explicit pointer types.<br>
Regarding Rust, you are wrong.<br>
I have built the latest Rust compiler.<br>
<br>
import io;<br>
<br>
fn modify(&a:int){<br>
a = 2;<br>
}<br>
fn swap<T>(&a:T,&b:T){<br>
let tmp<-a;<br>
a<-b;<br>
b<-tmp;<br>
}<br>
<br>
</blockquote></div><div><br></div>The `fn foo(&a: T)` syntax is being deprecated in favor of `fn foo(a: &mut T)`.<div><br></div><div>So your modify function becomes: `fn modify(a: &mut int)`, and gets called as `modify(&mut a)`.</div>
<div><br></div><div>Your swap function becomes `fn swap<T>(a: &mut T, b: &mut T)` and gets called as `swap(&mut a, &mut b)`.<div>
<br><div>So effectively, Rust also opted for explicit ref at the call site.</div><div><br clear="all">--<br>Ziad<br></div>
</div>
</div>