Discussion on Go and D
Andrej Mitrovic
andrej.mitrovich at gmail.com
Sun Apr 8 17:46:10 PDT 2012
On 4/9/12, Manu <turkeyman at gmail.com> wrote:
> (...why can't you use 'ref' in regular declarations? I frequently find
> myself wanting to use ref locally for this exact reason.)
I think the reason for this was because references are supposed to be
hidden from the user.
But if you look it from a safety angle you can escape a reference to a
local variable (ends up being garbage after function exit), but you
can't escape an alias declaration (I think so anywho).
More information about the Digitalmars-d
mailing list