3 ms·
If they added support for `range 10` to iterate 0-9 this would be useful for doing things a certain number of times. Now it's probably mostly useful for emptyin
by thomasahle 12y ago
If they added support for `range 10` to iterate 0-9 this would be useful for doing things a certain number of times. Now it's probably mostly useful for emptying iterators.
- andrewchambers 12y agoWhy do they need to add support for this? it already exists... https://github.com/bradfitz/iter/blob/master/iter.go https://github.com/bradfitz/iter/blob/master/iter.go
- thomasahle 12y agoI don't think that would be considered good Go code. It's no shorter than writing out the 3-part for loop, and it is probably slower.
- andrewchambers 12y agowhat extra operations do you think range on a slice would do? The generated assembly is probably the same. Stylistically it is odd however.