Dave, the example you have on your blog post is the same as the one in spec 
I linked and is different than mine - the f is called before a is 
evaluated, if we assumed left-to-right evaluation order. In the spec's 
example a is evaluated before f is called.

I tested my example on both gccgo and go and it gives the same result - "3 
2". Thus the question.

Nevertheless the rationale given by Ian makes sense to me, so for the time 
being I will assume it's not safe to write code that depends on this 
behavior.

Thank you for all your comments!

--
Rafal

On Tuesday, December 13, 2016 at 9:50:43 PM UTC+1, Dave Cheney wrote:
>
> The order of evaluation is not specified. We found a few years ago that 
> gccgo and gc differed in this respect and _both_ implantations are correct. 
>
> https://dave.cheney.net/2013/11/15/evaluation-order-oddity
>

-- 
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.

Reply via email to