On 9 April 2012 04:09, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote:

> On 4/9/12, Manu <turkey...@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.
>

Nobody returns a ref to a local from a function, and the compiler can
easily warn about that.
Sure, but that's all this was ever meant to be right? alias as a sugar to
simplify long expressions... except alias is unsafe too, but in a different
and more subtle way.

Reply via email to