Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2765)

Issue 14419054: code review 14419054: spec: clarify re-use of underlying arrays in slice oper... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 7 months ago by gri
Modified:
8 years, 7 months ago
Reviewers:
minux1, r, rsc, iant
CC:
rsc, iant, r, ken2, minux1, kortschak, rog, peterGo, golang-dev
Visibility:
Public.

Description

spec: clarify re-use of underlying arrays in slice operations Please note the slight rewording for append: The spec now requires that append reuses the underlying array if it is sufficiently large. Per majority sentiment. This is technically a language change but the current implementation always worked this way. Fixes issue 5818. Fixes issue 5180.

Patch Set 1 #

Patch Set 2 : diff -r b696837bda3e https://code.google.com/p/go #

Patch Set 3 : diff -r b696837bda3e https://code.google.com/p/go #

Patch Set 4 : diff -r b696837bda3e https://code.google.com/p/go #

Total comments: 2

Patch Set 5 : diff -r b696837bda3e https://code.google.com/p/go #

Total comments: 6

Patch Set 6 : diff -r 3f38e968e072 https://code.google.com/p/go #

Total comments: 2

Patch Set 7 : diff -r 9d0d95344a6c https://code.google.com/p/go #

Patch Set 8 : diff -r 9d0d95344a6c https://code.google.com/p/go #

Patch Set 9 : diff -r 9d0d95344a6c https://code.google.com/p/go #

Patch Set 10 : diff -r 9d0d95344a6c https://code.google.com/p/go #

Total comments: 2

Patch Set 11 : diff -r c67a1d0df694 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -24 lines) Patch
M doc/go_spec.html View 1 2 3 4 5 6 6 chunks +17 lines, -24 lines 0 comments Download

Messages

Total messages: 30
gri
Hello rsc@golang.org, iant@golang.org, r@golang.org, ken@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to ...
8 years, 7 months ago (2013-10-09 22:54:39 UTC) #1
r
LGTM but wait for others https://codereview.appspot.com/14419054/diff/6001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/6001/doc/go_spec.html#newcode5356 doc/go_spec.html:5356: The resulting slice may ...
8 years, 7 months ago (2013-10-09 23:00:25 UTC) #2
gri
PTAL https://codereview.appspot.com/14419054/diff/6001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/6001/doc/go_spec.html#newcode5356 doc/go_spec.html:5356: The resulting slice may refer to a different ...
8 years, 7 months ago (2013-10-09 23:05:24 UTC) #3
iant
https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html#newcode893 doc/go_spec.html:893: it, so these two examples result in the same ...
8 years, 7 months ago (2013-10-10 00:00:43 UTC) #4
minux1
https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html#newcode5356 doc/go_spec.html:5356: The resulting slice may refer to a different underlying ...
8 years, 7 months ago (2013-10-10 00:41:30 UTC) #5
gri
PTAL https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html#newcode893 doc/go_spec.html:893: it, so these two examples result in the ...
8 years, 7 months ago (2013-10-10 00:54:10 UTC) #6
iant
On 2013/10/10 00:41:30, minux wrote: > > https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html#newcode5356 > > doc/go_spec.html:5356: The resulting slice may ...
8 years, 7 months ago (2013-10-10 00:58:40 UTC) #7
iant
LGTM
8 years, 7 months ago (2013-10-10 00:59:12 UTC) #8
minux1
https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html#newcode5356 doc/go_spec.html:5356: The resulting slice may refer to a different underlying ...
8 years, 7 months ago (2013-10-10 01:04:21 UTC) #9
minux1
On Wed, Oct 9, 2013 at 8:58 PM, <iant@golang.org> wrote: > I don't think we ...
8 years, 7 months ago (2013-10-10 01:13:36 UTC) #10
gri
https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/12001/doc/go_spec.html#newcode5356 doc/go_spec.html:5356: The resulting slice may refer to a different underlying ...
8 years, 7 months ago (2013-10-10 01:14:22 UTC) #11
minux1
On Wed, Oct 9, 2013 at 9:14 PM, <gri@golang.org> wrote: > sensible implementation will use ...
8 years, 7 months ago (2013-10-10 01:21:47 UTC) #12
kortschak
https://codereview.appspot.com/14419054/diff/13001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/13001/doc/go_spec.html#newcode5357 doc/go_spec.html:5357: For instance, if the capacity of <code>s</code> is not ...
8 years, 7 months ago (2013-10-10 01:45:59 UTC) #13
gri
https://codereview.appspot.com/14419054/diff/13001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/13001/doc/go_spec.html#newcode5357 doc/go_spec.html:5357: For instance, if the capacity of <code>s</code> is not ...
8 years, 7 months ago (2013-10-10 05:35:56 UTC) #14
rog
I appreciate the arguments for keeping this undefined, but I couldn't guarantee that I haven't ...
8 years, 7 months ago (2013-10-10 10:04:28 UTC) #15
gri
I'd argue that the fill function should return the filled slice. The comment does say ...
8 years, 7 months ago (2013-10-10 16:25:08 UTC) #16
rog
On 10 October 2013 17:25, Robert Griesemer <gri@golang.org> wrote: > I'd argue that the fill ...
8 years, 7 months ago (2013-10-10 18:42:38 UTC) #17
rsc
FWIW I agree with Minux and Roger: we should define (if we haven't already) that ...
8 years, 7 months ago (2013-10-10 18:50:43 UTC) #18
peterGo
As a practical matter, it's important for Go performance to minimize allocations. For slices, it ...
8 years, 7 months ago (2013-10-10 19:16:23 UTC) #19
gri
Any other input? r? iant? I remain unconvinced that defining that append must re-use the ...
8 years, 7 months ago (2013-10-11 21:37:17 UTC) #20
kortschak
On 2013/10/11 21:37:17, gri wrote: > Any other input? r? iant? > > I remain ...
8 years, 7 months ago (2013-10-13 22:39:20 UTC) #21
gri
On 2013/10/13 22:39:20, kortschak wrote: > On 2013/10/11 21:37:17, gri wrote: > > Any other ...
8 years, 7 months ago (2013-10-14 18:14:43 UTC) #22
gri
Hello rsc@golang.org, iant@golang.org, r@golang.org, ken@golang.org, minux.ma@gmail.com, dan.kortschak@adelaide.edu.au, rogpeppe@gmail.com, go.peter.90@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
8 years, 7 months ago (2013-10-16 00:26:17 UTC) #23
gri
FYI: This is now rephrasing the contentious bit in append: It leaves what was there ...
8 years, 7 months ago (2013-10-16 00:30:36 UTC) #24
minux1
thank you. LGTM.
8 years, 7 months ago (2013-10-16 00:36:15 UTC) #25
r
LGTM
8 years, 7 months ago (2013-10-16 22:51:26 UTC) #26
iant
LGTM https://codereview.appspot.com/14419054/diff/22001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/22001/doc/go_spec.html#newcode5358 doc/go_spec.html:5358: array that fits both the existing slice elements ...
8 years, 7 months ago (2013-10-16 22:57:52 UTC) #27
gri
https://codereview.appspot.com/14419054/diff/22001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/14419054/diff/22001/doc/go_spec.html#newcode5358 doc/go_spec.html:5358: array that fits both the existing slice elements and ...
8 years, 7 months ago (2013-10-16 23:09:15 UTC) #28
rsc
LGTM
8 years, 7 months ago (2013-10-16 23:15:47 UTC) #29
gri
8 years, 7 months ago (2013-10-16 23:16:58 UTC) #30
*** Submitted as https://code.google.com/p/go/source/detail?r=d38922f92be6 ***

spec: clarify re-use of underlying arrays in slice operations

Please note the slight rewording for append: The spec now
requires that append reuses the underlying array if it is
sufficiently large. Per majority sentiment.

This is technically a language change but the current
implementation always worked this way.

Fixes issue 5818.
Fixes issue 5180.

R=rsc, iant, r, ken, minux.ma, dan.kortschak, rogpeppe, go.peter.90
CC=golang-dev
https://codereview.appspot.com/14419054
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b