From: Robert Griesemer
Date: Tue, 25 Feb 2014 17:13:37 +0000 (-0800)
Subject: spec: clarify default "true" condition/tag in for/switch statements
X-Git-Tag: go1.3beta1~577
X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ab26623182bb94e1b29668d86b5ee387991926fe;p=gostls13.git
spec: clarify default "true" condition/tag in for/switch statements
An absent condition/tag in for and switch statements is equivalent
to the predeclared constant true; not simply the expression true
(which might lead to a locally defined true).
Not a language change.
Fixes #7404.
LGTM=iant, r
R=r, iant, rsc, ken
CC=golang-codereviews
https://golang.org/cl/68150046
---
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 3b6769d740..6bde7ab6fc 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
@@ -4459,8 +4459,8 @@ If no case matches and there is a "default" case,
its statements are executed.
There can be at most one default case and it may appear anywhere in the
"switch" statement.
-A missing switch expression is equivalent to
-the expression true
.
+A missing switch expression is equivalent to the boolean value
+true
.
@@ -4625,7 +4625,8 @@ Condition = Expression .
In its simplest form, a "for" statement specifies the repeated execution of
a block as long as a boolean condition evaluates to true.
The condition is evaluated before each iteration.
-If the condition is absent, it is equivalent to true
.
+If the condition is absent, it is equivalent to the boolean value
+true
.
@@ -4662,7 +4663,8 @@ only if the block was executed).
Any element of the ForClause may be empty but the
semicolons are
required unless there is only a condition.
-If the condition is absent, it is equivalent to true
.
+If the condition is absent, it is equivalent to the boolean value
+true
.