diff options
author | Robert Griesemer <gri@golang.org> | 2010-10-27 10:44:31 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2010-10-27 10:44:31 -0700 |
commit | 904adfdc46507b3ddfe0f8b742b8414df31052d2 (patch) | |
tree | 9226dafb6488d214551cfce66c5d3edf61bfc890 | |
parent | ad7d24ac4b66f9ee83e1cb5f81c3ae4cb3eb5610 (diff) | |
download | go-904adfdc46507b3ddfe0f8b742b8414df31052d2.tar.gz go-904adfdc46507b3ddfe0f8b742b8414df31052d2.zip |
go spec: clarify return type of append, argument type for ...T parameters
R=iant, ken2, r, rsc
CC=golang-dev
https://golang.org/cl/2774041
-rw-r--r-- | doc/go_spec.html | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html index 835f9dd49e..5acb8169ab 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,5 +1,5 @@ <!-- title The Go Programming Language Specification --> -<!-- subtitle Version of Oct 26, 2010 --> +<!-- subtitle Version of Oct 27, 2010 --> <!-- TODO @@ -2639,9 +2639,9 @@ within <code>Greeting</code>, <code>who</code> will have the value </p> <p> -If the final argument is of slice type <code>[]T</code>, it may be passed unchanged as the value -for a <code>...T</code> parameter if the argument is followed by <code>...</code>. -In this case no new slice is created. +If the final argument is assignable to a slice type <code>[]T</code>, it may be +passed unchanged as the value for a <code>...T</code> parameter if the argument +is followed by <code>...</code>. In this case no new slice is created. </p> <p> @@ -4535,12 +4535,13 @@ Two built-in functions assist in common slice operations. <p> The function <code>append</code> appends zero or more values <code>x</code> -to a slice <code>s</code> and returns the resulting slice. Each value must be -<a href="#Assignability">assignable</a> to the slice's element type. +to a slice <code>s</code> and returns the resulting slice, with the same type +as s. Each value must be <a href="#Assignability">assignable</a> to the slice's +element type. </p> <pre class="grammar"> -append(s []T, x ...T) []T +append(s S, x ...T) S // S is assignable to []T </pre> <p> |