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

Issue 6699048: code review 6699048: go spec: restrictions for index and slice expressions (Closed)

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

Description

go spec: restrictions for index and slice expressions At the moment, gc and gccgo report compile- time errors for certain constant indexes that are out of bounds. The spec however requests a run-time panic for out-of-bounds indexes (http://tip.golang.org/ref/spec#Indexes). Document the status quo. Fixes issue 4231.

Patch Set 1 #

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

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

Total comments: 2

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

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

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

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

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

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

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

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

Total comments: 2

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

Total comments: 2

Patch Set 13 : diff -r bb1308d3d6e6 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -16 lines) Patch
M doc/go_spec.html View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +37 lines, -16 lines 0 comments Download

Messages

Total messages: 13
gri
Hello r@golang.org, rsc@golang.org, iant@golang.org, ken@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to ...
12 years, 4 months ago (2012-10-15 23:24:29 UTC) #1
iant
https://codereview.appspot.com/6699048/diff/4001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/6699048/diff/4001/doc/go_spec.html#newcode2504 doc/go_spec.html:2504: <li>if <code>x</code> is a <a href="#Constant_expressions">constant expression</a> it must ...
12 years, 4 months ago (2012-10-15 23:41:58 UTC) #2
gri
https://codereview.appspot.com/6699048/diff/4001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/6699048/diff/4001/doc/go_spec.html#newcode2504 doc/go_spec.html:2504: <li>if <code>x</code> is a <a href="#Constant_expressions">constant expression</a> it must ...
12 years, 4 months ago (2012-10-16 03:33:26 UTC) #3
gri
Hello r@golang.org, rsc@golang.org, iant@golang.org, ken@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 4 months ago (2012-10-16 04:51:36 UTC) #4
iant
LGTM What about slice expressions?
12 years, 4 months ago (2012-10-16 13:04:48 UTC) #5
gri
Hello r@golang.org, rsc@golang.org, iant@golang.org, ken@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 4 months ago (2012-10-16 16:44:35 UTC) #6
rsc
The semantics look good to me. Some wording nits. "run time" is a noun, "run-time" ...
12 years, 4 months ago (2012-10-16 19:04:20 UTC) #7
gri
Hello r@golang.org, rsc@golang.org, iant@golang.org, ken@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 4 months ago (2012-10-16 20:08:52 UTC) #8
r
LGTM although i share gri's nervousness. we should probably have a serious talk about how ...
12 years, 4 months ago (2012-10-16 22:01:25 UTC) #9
gri
PTAL. I wouldn't want to push it much farther in the spec. We already have ...
12 years, 4 months ago (2012-10-16 23:23:18 UTC) #10
r
LGTM
12 years, 4 months ago (2012-10-17 03:36:34 UTC) #11
iant
LGTM https://codereview.appspot.com/6699048/diff/23002/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/6699048/diff/23002/doc/go_spec.html#newcode2531 doc/go_spec.html:2531: if the string <code>a</code> is constant, too</li> s/constant, ...
12 years, 4 months ago (2012-10-17 17:12:21 UTC) #12
gri
12 years, 4 months ago (2012-10-17 18:08:55 UTC) #13
*** Submitted as http://code.google.com/p/go/source/detail?r=370bc7ed6c28 ***

go spec: restrictions for index and slice expressions

At the moment, gc and gccgo report compile-
time errors for certain constant indexes that
are out of bounds. The spec however requests
a run-time panic for out-of-bounds indexes
(http://tip.golang.org/ref/spec#Indexes).

Document the status quo.

Fixes issue 4231.

R=r, rsc, iant, ken
CC=golang-dev
http://codereview.appspot.com/6699048

http://codereview.appspot.com/6699048/diff/23002/doc/go_spec.html
File doc/go_spec.html (right):

http://codereview.appspot.com/6699048/diff/23002/doc/go_spec.html#newcode2531
doc/go_spec.html:2531: if the string <code>a</code> is constant, too</li>
On 2012/10/17 17:12:21, iant wrote:
> s/constant, too/also constant/

Done.
Sign in to reply to this message.

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