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
[ Parent
| on HN ]
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.