Iterators in Go

Iterators in Go

This article describes a proposed extension to the Go language: range over func. The proposal is evolving, and this tutorial is a work in progress, so don’t forget to check back later for the latest developments.

11 points · 2 comments · view on lemmy.world

2 Comments

SleepyHarry@sh.itjust.works · 2 pts · 3y (1 reply)

The syntax strikes me as a little clunky, but I do like the idea. Coming from Python I've used generators a lot (which in my obviously biased opinion is a clearer name that "iterator" here) so recognise the value in having something like that in the language.

nebiros@programming.dev · 1 pts · 3y

probably they gonna end up with its own generic type at the stdlib