Re: Smart pointers instead of GC?

2014-02-04 Thread Matthias Einwag
By the way, while this statement was true for initial design, they have recently moved to much more simple model, replacing most of more complicated pointer types with library solutions. I think those who refer to Rust example are more likely to have in mind that new model and your judgement se

Re: Smart pointers instead of GC?

2014-02-04 Thread Matthias Einwag
A function that takes a borrowed pointer &T can also be called with an owning pointer ~T, an RC pointer Rc, or a GC pointer Gc. They all convert neatly to a &T. One function to rule them ... err .. accomodate all. No. That would be nice to have, but it's actually not the case. The only type t

Re: Smart pointers instead of GC?

2014-02-05 Thread Matthias Einwag
Again, what happens with: T identity(T t) { return t; } ? I.e. the transference of the argument pointer type to the return type? As far as I see, in Rust the pointer type is lost on the return value as well, if your function takes a reference (borrowed pointer). But you can do: fn id