Discussion on Go and D

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Apr 8 18:09:14 PDT 2012


On 4/9/12, Manu <turkeyman at gmail.com> wrote:
> I don't follow. Can you give an example that shows this insecurity?

I mean escaping references to locals:

ref int xref;
void foo() {
   int x;
   xref = x;
}

or

ref int foo() {
   int x;
   ref int xref = x;
   return xref;
}

I mean a ref would basically be a pointer with some syntax sugar, no?
It would have the same drawbacks as a pointer.


More information about the Digitalmars-d mailing list