3 ms·
I assume you mean "any lvalue"? You can't take the address of rvalues, can you?
by ootachi 15y ago
I assume you mean "any lvalue"? You can't take the address of rvalues, can you?
- deleted 15y ago[deleted]
- SteveMcQwark 15y agoEssentially, you are correct. Lvalues can have their address taken while rvalues cannot. However, the Go spec doesn't speak in terms of lvalue vs rvalue, it speaks in terms of the addressability of different kinds of expressions.
- enneff 15y agoGo doesn't define "lvalues," in the spec, but it does define "addressability." My comment would be more accurate if I had said "Go lets you take the address of any value in memory." (stack or heap)