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

Issue 11884043: code review 11884043: spec: clarify index and selector expressions (Closed)

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

Description

spec: clarify index and selector expressions 1) Explain a[i] and a[i:j] where a is of type *A as shortcut for (*a)[i] and (*a)[i:j], respectively. 2) Together with 1), because len() of nil slices is well defined, there's no need to special case nil operands anymore. 3) The result of indexing or slicing a constant string is always a non-constant byte or string value. 4) The result of slicing an untyped string is a value of type string. 5) If the operand of a valid slice a[i:j] is nil (i, j must be 0 for it to be valid - this already follows from the in-range rules), the result is a nil slice. Fixes issue 4913. Fixes issue 5951.

Patch Set 1 #

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

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

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

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

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

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

Total comments: 6

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

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

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -31 lines) Patch
M doc/go_spec.html View 1 2 3 4 5 6 7 8 chunks +44 lines, -31 lines 2 comments Download

Messages

Total messages: 9
gri
Hello rsc@golang.org, r@golang.org, iant@golang.org, ken@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to ...
11 years, 8 months ago (2013-07-26 00:03:08 UTC) #1
gri
friendly ping (this is not change but a more complete documentation of the status quo) ...
11 years, 8 months ago (2013-07-30 15:59:45 UTC) #2
r
https://codereview.appspot.com/11884043/diff/15001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/11884043/diff/15001/doc/go_spec.html#newcode2553 doc/go_spec.html:2553: <li><code>a[x]</code> is a shortcut for <code>(*a)[x]</code></li> "shortcut" is a ...
11 years, 8 months ago (2013-07-31 03:41:37 UTC) #3
gri
PTAL https://codereview.appspot.com/11884043/diff/15001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/11884043/diff/15001/doc/go_spec.html#newcode2553 doc/go_spec.html:2553: <li><code>a[x]</code> is a shortcut for <code>(*a)[x]</code></li> On 2013/07/31 ...
11 years, 8 months ago (2013-07-31 20:30:58 UTC) #4
gri
*** Submitted as https://code.google.com/p/go/source/detail?r=bfd5ed8236d5 *** spec: clarify index and selector expressions 1) Explain a[i] and ...
11 years, 8 months ago (2013-07-31 20:40:05 UTC) #5
r
I didn't LGTM this.
11 years, 8 months ago (2013-07-31 21:06:40 UTC) #6
gri
oops - my bad. I used the wrong CL #. Will revert. - gri On ...
11 years, 8 months ago (2013-07-31 21:07:35 UTC) #7
r
https://codereview.appspot.com/11884043/diff/23001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/11884043/diff/23001/doc/go_spec.html#newcode2676 doc/go_spec.html:2676: otherwise they are <i>out of range</i>. look at line ...
11 years, 8 months ago (2013-07-31 21:09:16 UTC) #8
gri
11 years, 8 months ago (2013-07-31 21:23:13 UTC) #9
Message was sent while issue was closed.
https://codereview.appspot.com/11884043/diff/23001/doc/go_spec.html
File doc/go_spec.html (right):

https://codereview.appspot.com/11884043/diff/23001/doc/go_spec.html#newcode2676
doc/go_spec.html:2676: otherwise they are <i>out of range</i>.
On 2013/07/31 21:09:16, r wrote:
> look at line 2532.

Line 2532 defines these terms for index expressions, this section defines them
for slice expressions.

But perhaps I am missing something?

Please comment on new CL 12198043.
Sign in to reply to this message.

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