]> Cypherpunks repositories - gostls13.git/commit
spec: permit "for range x" (no index variables)
authorRobert Griesemer <gri@golang.org>
Mon, 14 Jul 2014 22:08:09 +0000 (15:08 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 14 Jul 2014 22:08:09 +0000 (15:08 -0700)
commit20ae6d9bc58f98355fcab6501e0fcb2c5b34f44c
treeef3ef43ee4c77ab3486e2b59dd4f6dc77074793a
parent8b836fa87234c5809891eceaeb87f63223217999
spec: permit "for range x" (no index variables)

This is a fully backward-compatible language change.

There are not a lot of cases in the std library, but
there are some. Arguably this makes the syntax a bit
more regular - any trailing index variable that is _
can be left away, and there's some analogy to type
switches where the temporary can be left away.

Implementation-wise the change should be trivial as
it can be done completely syntactically. For instance,
the respective change in go/parser is a dozen lines
(see https://golang.org/cl/112970044 ).

Fixes #6102.

LGTM=iant, r, rsc
R=r, rsc, iant, ken
CC=golang-codereviews
https://golang.org/cl/104680043
doc/go_spec.html