News for hackers. Stuff that matters.
Re:Go: Redefining For Loop Variable Semantics by maccard on Tuesday October 11, 2022 @05:10AM (#33161030)
> Maybe internally it clones these references -shrug.

That's what go does under the hood in 95% of cases. If I do:

func foo(a int) int { return &a }

func main() { fmt.Println(foo(3)) }

It does the right thing. It's just that in this case (and in lambdas) they got it wrong.

There are no comments on this comment yet.