4 ms·
There's an experimental feature in Go that lets you write python-like generators that work with range() and the callback is called `yield`. Here's some details:
by t8sr 3y ago
There's an experimental feature in Go that lets you write python-like generators that work with range() and the callback is called `yield`. Here's some details: https://go.dev/wiki/RangefuncExperiment https://go.dev/wiki/RangefuncExperiment
That's probably what the post is talking about.
(I personally don't love this change, but now that it's clear Go 2.0 won't happen, it seems like some of the more outlandish ideas are making it into Go 1.x. Ah well.)
- gouggoug 3y agoInteresting, I wasn’t aware of this experimental feature. I still think the post was AI generated. Reason being that “now that go has yield” implies this is an actual available feature of go. It’s not. And I’d find it very surprising someone would refer to an experimental feature without mentioning it’s experimental.