]> Cypherpunks repositories - gostls13.git/commitdiff
spec: permit trailing comma in conversions
authorRobert Griesemer <gri@golang.org>
Wed, 26 Sep 2012 17:31:57 +0000 (10:31 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 26 Sep 2012 17:31:57 +0000 (10:31 -0700)
Also: Adjust prose in Conversions section
to be consistent.

This is a backward-compatible syntax change.
For a discussion see issue 2568.

Fixes #2568.
Fixes #4123.

R=golang-dev, r, iant, rsc
CC=golang-dev
https://golang.org/cl/6572049

doc/go_spec.html

index 7e5d5042ed8fab26e1ef70e53b0dea837e626432..2b9f14428b15f3d11ae5d5be091c973a2e633728 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of September 22, 2012",
+       "Subtitle": "Version of September 26, 2012",
        "Path": "/ref/spec"
 }-->
 
@@ -3390,7 +3390,7 @@ that can be converted to type <code>T</code>.
 </p>
 
 <pre class="ebnf">
-Conversion = Type "(" Expression ")" .
+Conversion = Type "(" Expression [ "," ] ")" .
 </pre>
 
 <p>
@@ -3464,12 +3464,11 @@ in any of these cases:
        <code>x</code>'s type and <code>T</code> are both complex types.
        </li>
        <li>
-       <code>x</code> is an integer or has type <code>[]byte</code> or
-       <code>[]rune</code> and <code>T</code> is a string type.
+       <code>x</code> is an integer or a slice of bytes or runes
+       and <code>T</code> is a string type.
        </li>
        <li>
-       <code>x</code> is a string and <code>T</code> is <code>[]byte</code> or
-       <code>[]rune</code>.
+       <code>x</code> is a string and <code>T</code> is a slice of bytes or runes.
        </li>
 </ul>