Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The GP's example is equivalent to pushing to the tail of a queue while you're consuming its head, which is a relatively common (and safe) pattern. It looks like the Go designers made this pattern a bit harder to express, in favour of making the general case a bit harder to mess up.


> the Go designers made this pattern a bit harder to express

GP can just do an old-school `for` loop without a `range` clause (generally everyone learns about `for` before learning about `range`) and this immediately becomes incredibly easy to express.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: