From: Rob Pike Date: Sat, 12 Jun 2010 04:30:03 +0000 (-0700) Subject: spec: clarify that result parameters are always zeroed before the function executes. X-Git-Tag: weekly.2010-06-21~43 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=db8c2b1803c2ae42306bbd8071b5831d8382657d;p=gostls13.git spec: clarify that result parameters are always zeroed before the function executes. R=golang-dev CC=golang-dev https://golang.org/cl/1641043 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 9e0994707e..e2637d96cd 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -4190,8 +4190,7 @@ func complex_f2() (re float, im float) {
  • The expression list may be empty if the functions's result type specifies names for its result parameters (§Function Types). - The result parameters act as ordinary local variables that are - initialized to the zero values for their type (§The zero value) + The result parameters act as ordinary local variables and the function may assign values to them as necessary. The "return" statement returns the values of these variables.
    @@ -4204,6 +4203,10 @@ func complex_f3() (re float, im float) {
     	
  • +

    +Regardless of how they are declared, all the result values are initialized to the zero values for their type (§The zero value) upon entry to the function. +

    +