On Tue, Dec 13, 2016 at 6:46 AM, Jesper Louis Andersen <jesper.louis.ander...@gmail.com> wrote: > On Tue, Dec 13, 2016 at 2:57 PM Rafał Jęczalik <rafal.jecza...@gmail.com> > wrote: >> >> Hey Gophers! >> >> Does the spec guarantees the following program will always output "3 2"? >> > > Yes. f() is in funcall context, and there the order is lexicographic > left-to-right as the specification says.
I'm sorry, I don't agree. It's clear that the first value printed will always be 3. But the spec does not guarantee when the second argument to p is evaluated. It may be evaluated before call of f, in which case the program will print 1, or it may be evaluated after the call of f, in which case the program will print 2. The spec does not actually say that all function call arguments are evaluated in left to right order. It says that among the arguments, all function calls, method calls, and communication expressions are evaluated in left to right order. That is not quite the same thing. Ian -- 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.