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

Issue 5440117: code review 5440117: spec: allow comparison of structs, arrays containing co... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 3 months ago by rsc
Modified:
13 years, 2 months ago
Reviewers:
CC:
r, gri, r2, iant, cw, bradfitz, golang-dev
Visibility:
Public.

Description

spec: allow comparison of structs, arrays containing comparable values Also, clarify when interface comparison panics and that comparison to nil is a special syntax rather than a general comparison rule.

Patch Set 1 #

Total comments: 11

Patch Set 2 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 3 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Total comments: 5

Patch Set 4 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Total comments: 5

Patch Set 5 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 6 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 8 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 10 : diff -r 94f169a6eb9a https://go.googlecode.com/hg/ #

Patch Set 11 : diff -r 82048b702db8 https://go.googlecode.com/hg/ #

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

Messages

Total messages: 34
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 3 months ago (2011-12-06 15:37:59 UTC) #1
r
http://codereview.appspot.com/5440117/diff/1/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/1/doc/go_spec.html#newcode2939 doc/go_spec.html:2939: apply to operands that are <i>orderable</i>. s/orderable/ordered/ no need ...
13 years, 3 months ago (2011-12-06 16:36:54 UTC) #2
rsc
PTAL http://codereview.appspot.com/5440117/diff/1/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/1/doc/go_spec.html#newcode2994 doc/go_spec.html:2994: The values are equal if their corresponding fields ...
13 years, 3 months ago (2011-12-06 16:58:08 UTC) #3
r2
On Dec 6, 2011, at 8:58 AM, rsc@golang.org wrote: > On 2011/12/06 16:36:54, r wrote: ...
13 years, 3 months ago (2011-12-06 17:14:43 UTC) #4
r
http://codereview.appspot.com/5440117/diff/4001/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4001/doc/go_spec.html#newcode2979 doc/go_spec.html:2979: or if both are <code>nil</code>. i think that the ...
13 years, 3 months ago (2011-12-06 17:16:28 UTC) #5
gri
FYI http://codereview.appspot.com/5440117/diff/4001/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4001/doc/go_spec.html#newcode2951 doc/go_spec.html:2951: Integer values are comparable and ordered, in the ...
13 years, 3 months ago (2011-12-06 17:33:11 UTC) #6
rsc
On Tue, Dec 6, 2011 at 12:14, Rob 'Commander' Pike <r@google.com> wrote: > On Dec ...
13 years, 3 months ago (2011-12-06 17:50:26 UTC) #7
rsc
PTAL http://codereview.appspot.com/5440117/diff/4001/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4001/doc/go_spec.html#newcode2951 doc/go_spec.html:2951: Integer values are comparable and ordered, in the ...
13 years, 3 months ago (2011-12-06 17:51:11 UTC) #8
r
getting close http://codereview.appspot.com/5440117/diff/4/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4/doc/go_spec.html#newcode2967 doc/go_spec.html:2967: String values are comparable and ordered, lexically ...
13 years, 3 months ago (2011-12-06 18:03:11 UTC) #9
iant
LGTM http://codereview.appspot.com/5440117/diff/4/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4/doc/go_spec.html#newcode2960 doc/go_spec.html:2960: Complex values are comparable. We could consider saying ...
13 years, 3 months ago (2011-12-06 18:03:19 UTC) #10
gri
http://codereview.appspot.com/5440117/diff/4/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4/doc/go_spec.html#newcode2985 doc/go_spec.html:2985: and equal dynamic values or if both have value ...
13 years, 3 months ago (2011-12-06 18:06:11 UTC) #11
cw
I'm curious, other than nil why are function comparisons not allowed?
13 years, 3 months ago (2011-12-06 19:25:30 UTC) #12
gri
On Tue, Dec 6, 2011 at 11:25 AM, <cw@f00f.org> wrote: > I'm curious, other than ...
13 years, 3 months ago (2011-12-06 19:27:49 UTC) #13
bradfitz
On Tue, Dec 6, 2011 at 11:25 AM, <cw@f00f.org> wrote: > I'm curious, other than ...
13 years, 3 months ago (2011-12-06 19:30:30 UTC) #14
rsc
In addition to closures (which would be nice not to allocate), function equality has a ...
13 years, 3 months ago (2011-12-06 19:40:02 UTC) #15
rsc
On Tue, Dec 6, 2011 at 13:06, <gri@golang.org> wrote: > Comparison of an interface value ...
13 years, 3 months ago (2011-12-06 20:09:01 UTC) #16
rsc
PTAL
13 years, 3 months ago (2011-12-06 20:10:18 UTC) #17
r
http://codereview.appspot.com/5440117/diff/4006/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4006/doc/go_spec.html#newcode2936 doc/go_spec.html:2936: were first assigned to a temporary of the other ...
13 years, 3 months ago (2011-12-06 20:46:16 UTC) #18
gri
http://codereview.appspot.com/5440117/diff/4006/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/4006/doc/go_spec.html#newcode2936 doc/go_spec.html:2936: were first assigned to a temporary of the other ...
13 years, 3 months ago (2011-12-06 20:47:19 UTC) #19
rsc
On Tue, Dec 6, 2011 at 15:46, <r@golang.org> wrote: > http://codereview.appspot.com/5440117/diff/4006/doc/go_spec.html#newcode2936 > doc/go_spec.html:2936: were first ...
13 years, 3 months ago (2011-12-06 20:52:43 UTC) #20
rsc
On Tue, Dec 6, 2011 at 15:47, <gri@golang.org> wrote: > http://codereview.appspot.com/5440117/diff/4006/doc/go_spec.html#newcode3003 > doc/go_spec.html:3003: A comparison ...
13 years, 3 months ago (2011-12-06 20:55:49 UTC) #21
r2
On Dec 6, 2011, at 12:52 PM, Russ Cox wrote: > On Tue, Dec 6, ...
13 years, 3 months ago (2011-12-06 20:56:24 UTC) #22
rsc
On Tue, Dec 6, 2011 at 15:56, Rob 'Commander' Pike <r@google.com> wrote: > happy to ...
13 years, 3 months ago (2011-12-06 21:00:49 UTC) #23
rsc
never mind. this is what the compiler does but it is a mistake, because it ...
13 years, 3 months ago (2011-12-06 21:09:03 UTC) #24
rsc
PTAL In any comparison, the first operand must be <a href="#Assignability">assignable</a> to the type of ...
13 years, 3 months ago (2011-12-06 21:11:27 UTC) #25
gri
http://codereview.appspot.com/5440117/diff/6004/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/6004/doc/go_spec.html#newcode2990 doc/go_spec.html:2990: when values of type T are comparable and type ...
13 years, 3 months ago (2011-12-06 21:24:27 UTC) #26
rsc
updated: A non-interface value x of type T and an interface value are comparable when ...
13 years, 3 months ago (2011-12-06 21:25:56 UTC) #27
r
LGTM http://codereview.appspot.com/5440117/diff/6006/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/6006/doc/go_spec.html#newcode2989 doc/go_spec.html:2989: A non-interface value x of type T and ...
13 years, 3 months ago (2011-12-06 21:37:27 UTC) #28
rsc
PTAL I tweaked your wording ever so slightly, because the comparability does not depend on ...
13 years, 3 months ago (2011-12-06 21:43:08 UTC) #29
r2
LGTM
13 years, 3 months ago (2011-12-06 21:45:20 UTC) #30
gri
LGTM http://codereview.appspot.com/5440117/diff/2013/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/5440117/diff/2013/doc/go_spec.html#newcode2989 doc/go_spec.html:2989: A non-interface value <code>x</code> of type <code>X</code> and ...
13 years, 3 months ago (2011-12-06 22:01:07 UTC) #31
rsc
thanks. fixed both. On Tue, Dec 6, 2011 at 17:01, <gri@golang.org> wrote: > LGTM > ...
13 years, 3 months ago (2011-12-06 22:02:59 UTC) #32
gri
LGTM
13 years, 3 months ago (2011-12-06 22:28:38 UTC) #33
rsc
13 years, 2 months ago (2011-12-13 03:21:49 UTC) #34
*** Submitted as http://code.google.com/p/go/source/detail?r=5da1bc8899cf ***

spec: allow comparison of structs, arrays containing comparable values

Also, clarify when interface comparison panics and
that comparison to nil is a special syntax rather than
a general comparison rule.

R=r, gri, r, iant, cw, bradfitz
CC=golang-dev
http://codereview.appspot.com/5440117
Sign in to reply to this message.

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