News for hackers. Stuff that matters.
Re:Iterators are (maybe) coming to Go by assbuttbuttass on Saturday August 12, 2023 @10:14AM (#37100412)
I don't think it's so easy. An iterfunc doesn't store any state explicitly, so each time you call i it restarts from the beginning
Re:Iterators are (maybe) coming to Go by Groxx on Saturday August 12, 2023 @02:54PM (#37103126)
Aah, yes, that's an excellent point. Thanks! That does complicate things a lot more.

Quite a lot more, as it essentially means you can only consume from iterators you create... which sorta defeats the purpose of iterators as a value, and degrades them almost completely to just a `range` helper.