Indeed. The thread started 12 years ago. At the time I thought the idea of ranging over an int was just dumb, and un-go-like. But now it is out, I think it is great, and have run perl -pi -e 's/for (\w+) := 0; \1 < ([\w()]+); \1\+\+/for \1 := range \2/' $(git grep -l for) over my entire codebase to use it everywhere.
On Friday 16 February 2024 at 01:38:55 UTC Jorge Massih wrote: > Hey folks! Now in in Go v1.22 (released 02-06-2024) > <https://tip.golang.org/doc/go1.22> it's possible to iterate over a range > of integers by doing the approach mentioned at the beginning of this > conversation. > > - JM > El miércoles, 7 de enero de 2015 a la(s) 9:42:07 p.m. UTC-4, Sean Russell > escribió: > >> On Wednesday, January 7, 2015 11:51:03 AM UTC-5, tomwilde wrote: >>> >>> ... >>> >> Having introduced this convenience range-syntax where you can specify the >>> upper bound; wouldn't it by extension make sense to also allow the >>> programmer to specify a lower bound à la "x := range a, b". >>> >>> And from there people will want list comprehensions, texas ranges, etc, >>> etc... >>> >>> It's a slippery slope. >>> >> >> There are already people who want list comprehension; you don't need >> range syntax changes as a gateway feature for that. >> >> --- SER >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/197f8c57-c78e-48c8-b08a-761ab570189dn%40googlegroups.com.