Re: [go-nuts] Order of evaluation need more definition in spec

2019-03-16 Thread Michael Jones
Upon reflection I see that this is as you say. Not only expressed hazards, but even such mysterious cases as file system modification yb external scripts invoked by one argument and visible to another. On Sat, Mar 16, 2019 at 10:03 PM T L wrote: > > > On Friday, March 15, 2019 at 2:25:44 PM UTC-

Re: [go-nuts] Order of evaluation need more definition in spec

2019-03-16 Thread T L
On Friday, March 15, 2019 at 2:25:44 PM UTC-4, zs...@pinterest.com wrote: > > Thanks for response, I'm new here still need do more research on existing > topics. > > I understand compiler can do more optimization with less order > restriction, and I agree it's best to not coding in that way. T

Re: [go-nuts] Order of evaluation need more definition in spec

2019-03-15 Thread Michael Jones
Great idea! On Fri, Mar 15, 2019 at 11:25 AM zshi via golang-nuts < golang-nuts@googlegroups.com> wrote: > Thanks for response, I'm new here still need do more research on existing > topics. > > I understand compiler can do more optimization with less order > restriction, and I agree it's best to

Re: [go-nuts] Order of evaluation need more definition in spec

2019-03-15 Thread zshi via golang-nuts
Thanks for response, I'm new here still need do more research on existing topics. I understand compiler can do more optimization with less order restriction, and I agree it's best to not coding in that way. The problem is how to prevent people doing that since it's very similar to the usual re

Re: [go-nuts] Order of evaluation need more definition in spec

2019-03-14 Thread Ian Lance Taylor
On Thu, Mar 14, 2019 at 2:49 PM zshi via golang-nuts wrote: > > I'm a little bit confused with result from below code: > > func change(v *int) bool { > *v = 3 > return true > } > > func value(v int) int { > return v > } > > func main() { > b := 1 > fmt.Println(b + 1, value(b +

[go-nuts] Order of evaluation need more definition in spec

2019-03-14 Thread zshi via golang-nuts
I'm a little bit confused with result from below code: func change(v *int) bool { *v = 3 return true } func value(v int) int { return v } func main() { b := 1 fmt.Println(b + 1, value(b + 1), change(&b)) } Output: 4 2 true I expected 2 2 true. Then I checked spec