Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
ae13f438
Commit
ae13f438
authored
Jan 13, 2010
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify when expressions are evaluated for a range clause.
R=gri, rsc CC=golang-dev
https://golang.org/cl/189057
parent
14a74378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
go_spec.html
doc/go_spec.html
+6
-1
No files found.
doc/go_spec.html
View file @
ae13f438
...
@@ -3783,7 +3783,12 @@ string or array element or map value.
...
@@ -3783,7 +3783,12 @@ string or array element or map value.
The types of the array or slice index (always
<code>
int
</code>
)
The types of the array or slice index (always
<code>
int
</code>
)
and element, or of the map key and value respectively,
and element, or of the map key and value respectively,
must be
<a
href=
"#Assignment_compatibility"
>
assignment compatible
</a>
with
must be
<a
href=
"#Assignment_compatibility"
>
assignment compatible
</a>
with
the type of the iteration variables.
the type of the iteration variables. The expression on the right hand
side is evaluated once before beginning the loop. At each iteration
of the loop, the values produced by the range clause are assigned to
the left hand side as in an
<a
href=
"#Assignments"
>
assignment
statement
</a>
. Function calls on the left hand side will be evaluated
exactly once per iteration.
</p>
</p>
<p>
<p>
For strings, the "range" clause iterates over the Unicode code points
For strings, the "range" clause iterates over the Unicode code points
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment