On Mon, Aug 5, 2013 at 5:30 PM, Jonathan S. Shapiro <[email protected]>wrote:

> It is not. "ref" is merely "pass by reference". It makes no contract about
> escape. Three obvious counter examples:
>
> static T escape1(ref T arg) { return arg; }
>
static void escape2(ref X arg, T t) { arg.t = t }
> static void escape2(ref X arg, ref T t) { arg.t = t }
>

All of these are creating copies of t, they don't allow the reference to
escape.

Are you trying to forbid the values from escaping too, like Rust owned
pointers? Wouldn't you have to forbid the values from even being accessed
to prevent their escape? This sounds more like Rust's owned pointer concept
than borrowed pointers.

I thought the whole idea of borrowed pointers was that they are not
involved in GC tracing and lifetime, because they are only allowed when
someone else guarantees liveliness for the box. "ref" meets this
definition.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to