From ab26623182bb94e1b29668d86b5ee387991926fe Mon Sep 17 00:00:00 2001
From: Robert Griesemer
Date: Tue, 25 Feb 2014 09:13:37 -0800
Subject: [PATCH] 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
---
doc/go_spec.html | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
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
.
--
2.48.1