mirror of
https://github.com/golang/go
synced 2024-11-22 02:04:40 -07:00
spec edits for array slice change
R=r DELTA=6 (0 added, 2 deleted, 4 changed) OCL=27532 CL=27582
This commit is contained in:
parent
3a8ff8237a
commit
bcdc247f28
@ -1265,9 +1265,8 @@ be assigned to different types:
|
|||||||
The predeclared constant <code>nil</code> can be assigned to any
|
The predeclared constant <code>nil</code> can be assigned to any
|
||||||
pointer, function, slice, map, channel, or interface variable.
|
pointer, function, slice, map, channel, or interface variable.
|
||||||
<li>
|
<li>
|
||||||
Arrays can be assigned to slice variables with equal element type.
|
A pointer to an array can be assigned to a slice variable with equal element type.
|
||||||
When assigning to a slice variable, the array is not copied but a
|
The slice variable then refers to the original array; the data is not copied.
|
||||||
slice comprising the entire array is created.
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
A value can be assigned to an interface variable if the static
|
A value can be assigned to an interface variable if the static
|
||||||
@ -3006,7 +3005,7 @@ of which happen before receiving the value from the channel
|
|||||||
<code>c</code>.
|
<code>c</code>.
|
||||||
However, the order of those events compared to the evaluation of
|
However, the order of those events compared to the evaluation of
|
||||||
<code>f</code>, the evaluation of <code>x</code>, and the indexing
|
<code>f</code>, the evaluation of <code>x</code>, and the indexing
|
||||||
of <code>x</code> by the return value of
|
of <code>x</code> by the return value of
|
||||||
<code>i()</code> is not specified.
|
<code>i()</code> is not specified.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -3896,7 +3895,6 @@ result. <font color=red>TODO: clarify?</font>
|
|||||||
<li>
|
<li>
|
||||||
4a) Converting an integer value yields a string containing the UTF-8
|
4a) Converting an integer value yields a string containing the UTF-8
|
||||||
representation of the integer.
|
representation of the integer.
|
||||||
(TODO: this one could be done just as well by a library.)
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
string(0x65e5) // "\u65e5"
|
string(0x65e5) // "\u65e5"
|
||||||
@ -3904,8 +3902,8 @@ string(0x65e5) // "\u65e5"
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
4b) Converting an array or slice of bytes yields a string whose successive
|
4b) Converting a slice of bytes yields a string whose successive
|
||||||
bytes are those of the array/slice.
|
bytes are those of the slice.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
string([]byte{'h', 'e', 'l', 'l', 'o'}) // "hello"
|
string([]byte{'h', 'e', 'l', 'l', 'o'}) // "hello"
|
||||||
|
Loading…
Reference in New Issue
Block a user