]> Cypherpunks repositories - gostls13.git/commitdiff
fix description of iota to reflect reality.
authorRob Pike <r@golang.org>
Mon, 28 Apr 2008 23:19:59 +0000 (16:19 -0700)
committerRob Pike <r@golang.org>
Mon, 28 Apr 2008 23:19:59 +0000 (16:19 -0700)
SVN=117108

doc/go_lang.txt

index 405e543c98b8cab428eb94653a5d7756241cdd36..ea825f0f0e7fff7013a014eb16b45b58a309c373 100644 (file)
@@ -1246,9 +1246,11 @@ the others have.
 The constant generator 'iota'
 ----
 
-Within a declaration, each appearance of the keyword 'iota' represents a successive
-element of an integer sequence. It is reset to zero whenever the keyword 'const', 'type'
-or 'var' introduces a new declaration. For instance, 'iota' can be used to construct
+Within a declaration, the keyword 'iota' represents successive
+elements of an integer sequence.
+It is reset to zero whenever the keyword 'const'
+introduces a new declaration and increments as each identifier
+is declared. For instance, 'iota' can be used to construct
 a set of related constants:
 
   const (
@@ -1266,6 +1268,7 @@ a set of related constants:
   const x = iota;  // sets x to 0
   const y = iota;  // sets y to 0
 
+TODO: should iota work in var, type, func decls too?
 
 Statements
 ----