PS: Changed "Specifically" to "For instance". - Robert On Tue, Mar 23, 2010 at 4:49 ...
14 years, 11 months ago
(2010-03-23 23:52:29 UTC)
#2
PS: Changed "Specifically" to "For instance".
- Robert
On Tue, Mar 23, 2010 at 4:49 PM, <gri@golang.org> wrote:
> Reviewers: r, rsc, ken2, iant,
>
> Message:
> Hello r, rsc, ken2, iant (cc: golang-dev@googlegroups.com),
>
> I'd like you to review this change.
>
>
> Description:
> go spec: modification of defer statement
>
> Please review this at http://codereview.appspot.com/708041/show
>
> Affected files:
> M doc/go_spec.html
>
>
> Index: doc/go_spec.html
> ===================================================================
> --- a/doc/go_spec.html
> +++ b/doc/go_spec.html
> @@ -4281,7 +4281,12 @@
> function is not invoked.
> Deferred function calls are executed in LIFO order
> immediately before the surrounding function returns,
> -but after the return values, if any, have been evaluated.
> +after the return values, if any, have been evaluated, but before they
> +are returned to the caller. Specifically, if the deferred function is
> +a <a href="#Function_literals">function literal<a/> and the surrounding
> +function has <a href="#Function_types">named result parameters</a> that
> +are in scope within the literal, the deferred function may access the
> result
> +values returned by the surrounding function.
> </p>
>
> <pre>
> @@ -4292,6 +4297,14 @@
> for i := 0; i <= 3; i++ {
> defer fmt.Print(i)
> }
> +
> +// the result of f is 1
> +func f() (result int) {
> + defer func() {
> + result++
> + }()
> + return 0
> +}
> </pre>
>
> <h2 id="Built-in_functions">Built-in functions</h2>
>
>
>
LGTM http://codereview.appspot.com/708041/diff/13001/14001 File doc/go_spec.html (right): http://codereview.appspot.com/708041/diff/13001/14001#newcode2999 doc/go_spec.html:2999: A function result variable is not addressable. delete ...
14 years, 11 months ago
(2010-03-24 00:00:17 UTC)
#7
> http://codereview.appspot.com/708041/diff/13001/14001#newcode4944 > doc/go_spec.html:4944: <li><span class="alert">Method expressions are > not implemented.</span></li> > aren't these done? ...
14 years, 11 months ago
(2010-03-24 00:02:48 UTC)
#10
> http://codereview.appspot.com/708041/diff/13001/14001#newcode4944
> doc/go_spec.html:4944: <li><span class="alert">Method expressions are
> not implemented.</span></li>
> aren't these done?
6g has a bug in / incomplete code for method expressions when
T is an interface value, like io.Reader.Read.
Issue 708041: code review 708041: go spec: modification of defer statement
(Closed)
Created 14 years, 11 months ago by gri
Modified 14 years, 11 months ago
Reviewers:
Base URL:
Comments: 4