On Wed, Dec 9, 2009 at 20:35, Michael Hoisie <
hoi...@gmail.com> wrote:
> There's a function reflect.Indirect, which takes a Value and, if it's
> a PtrValue, returns the underlying Value.
>
> Is there an opposite of this function? Something like
> reflect.AddressOf, which takes a Value and returns a PtrValue to the
> underlying object? I can't seem to find it, but it would be really
> useful.
It would be, but no. The fundamental problem is that
once you've got a value, you can't just take its address:
an expression like &3 doesn't make any sense.
If the pointer is important, the solution is to keep
it around instead of throwing it away and trying to
get it back.
Russ