summaryrefslogtreecommitdiff
path: root/doc/go_spec.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/go_spec.html')
-rw-r--r--doc/go_spec.html23
1 files changed, 17 insertions, 6 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 156ee6a45..8c958b159 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,5 +1,5 @@
<!-- title The Go Programming Language Specification -->
-<!-- subtitle Version of May 14, 2010 -->
+<!-- subtitle Version of May 24, 2010 -->
<!--
Todo
@@ -3254,7 +3254,18 @@ that can be converted to type <code>T</code>.
</p>
<pre class="ebnf">
-Conversion = LiteralType "(" Expression ")" .
+Conversion = Type "(" Expression ")" .
+</pre>
+
+<p>
+If the type starts with an operator it must be parenthesized:
+</p>
+
+<pre>
+*Point(p) // same as *(Point(p))
+(*Point)(p) // p is converted to (*Point)
+&lt;-chan int(c) // same as &lt;-(chan int(c))
+(&lt;-chan int)(c) // c is converted to (&lt;-chan int)
</pre>
<p>
@@ -3318,11 +3329,11 @@ string containing the UTF-8 representation of the integer.
Negative values are converted to <code>"\uFFFD"</code>.
<pre>
-string('a') // "a"
-string(-1) // "\ufffd" == "\xef\xbf\xbd "
-string(0xf8) // "\u00f8" == "ø" == "\xc3\xb8"
+string('a') // "a"
+string(-1) // "\ufffd" == "\xef\xbf\xbd "
+string(0xf8) // "\u00f8" == "ø" == "\xc3\xb8"
type MyString string
-MyString(0x65e5) // "\u65e5" == "日" == "\xe6\x97\xa5"
+MyString(0x65e5) // "\u65e5" == "日" == "\xe6\x97\xa5"
</pre>
</li>