Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ae13f438
Commit
ae13f438
authored
15 years ago
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
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
doc/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.
The types of the array or slice index (always
<code>
int
</code>
)
and element, or of the map key and value respectively,
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>
For strings, the "range" clause iterates over the Unicode code points
...
...
This diff is collapsed.
Click to expand it.
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