On Tue, Mar 21, 2017 at 6:11 PM John McKown <john.archie.mck...@gmail.com> wrote:
> Logically yes, but due the implementation, along with "side effects" (undocumented?), it does. The "x[0]|=foo()" moves x[0] to a temporary area. It then invokes foo(). It then does the logical or from the "temporary area" (previous value of x[0]) with the return value from foo(), getting 3. Yeah, I got it, thanks to you both. Steven pointed me to the part of the specs I've read hundred times before and few times again before asking on the ML. The problem was that I repeatedly mentally misread 'indexing' for 'index evaluation'. As the index is a constant in this case, it lead me to believe it cannot have any effect on the result. But it's the 'indexing', the actual time when the value is loaded using the index, which is exempt from the 'left-to-right' evaluation rule for operands. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.