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

Issue 8672044: Create a classic set for strings.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by thumper
Modified:
11 years ago
Reviewers:
mp+158530, dave, fwereade, rog
Visibility:
Public.

Description

Create a classic set for strings. I got sick of the map[string]bool fluffing around when wanting a set of strings, so I wrote one. https://code.launchpad.net/~thumper/juju-core/string-set/+merge/158530 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 35

Patch Set 2 : Create a classic set for strings. #

Patch Set 3 : Create a classic set for strings. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+256 lines, -0 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
A utils/set/stringset.go View 1 1 chunk +113 lines, -0 lines 0 comments Download
A utils/set/stringset_test.go View 1 1 chunk +141 lines, -0 lines 0 comments Download

Messages

Total messages: 16
thumper
Please take a look.
11 years ago (2013-04-12 05:20:37 UTC) #1
rog
i think this the general idea is reasonable, but I have some suggestions below. https://codereview.appspot.com/8672044/diff/1/utils/set/stringset.go ...
11 years ago (2013-04-12 06:27:12 UTC) #2
rog
a few more comments https://codereview.appspot.com/8672044/diff/1/utils/set/stringset.go File utils/set/stringset.go (right): https://codereview.appspot.com/8672044/diff/1/utils/set/stringset.go#newcode15 utils/set/stringset.go:15: func MakeStringSet(initial ...string) StringSet { ...
11 years ago (2013-04-12 06:53:28 UTC) #3
TheMue
+1 one on most of Rogers comments, even if I would keep Add() etc if ...
11 years ago (2013-04-12 07:09:39 UTC) #4
rog
On 12 April 2013 08:09, <themue@gmail.com> wrote: > > +1 one on most of Rogers ...
11 years ago (2013-04-12 09:13:56 UTC) #5
TheMue
> Do is: > > for k := range myset { } > > (except ...
11 years ago (2013-04-12 09:25:02 UTC) #6
fwereade
This LGTM. I'm not sure what we get out of inventing our own quasi-set -- ...
11 years ago (2013-04-12 15:12:39 UTC) #7
rog
On 12 April 2013 16:12, <fwereade@gmail.com> wrote: > This LGTM. I'm not sure what we ...
11 years ago (2013-04-12 16:10:33 UTC) #8
rog
https://codereview.appspot.com/8672044/diff/1/utils/set/stringset.go File utils/set/stringset.go (right): https://codereview.appspot.com/8672044/diff/1/utils/set/stringset.go#newcode15 utils/set/stringset.go:15: func MakeStringSet(initial ...string) StringSet { On 2013/04/12 15:12:39, fwereade ...
11 years ago (2013-04-12 16:26:28 UTC) #9
dave_cheney.net
not lgtm. The only thing worse than having 1 utils package (trivial) is having two, ...
11 years ago (2013-04-12 23:43:09 UTC) #10
thumper
On 2013/04/12 23:43:09, dfc wrote: > not lgtm. > > The only thing worse than ...
11 years ago (2013-04-14 22:08:24 UTC) #11
thumper
Please take a look. https://codereview.appspot.com/8672044/diff/1/utils/set/stringset.go File utils/set/stringset.go (right): https://codereview.appspot.com/8672044/diff/1/utils/set/stringset.go#newcode9 utils/set/stringset.go:9: type StringSet struct { On ...
11 years ago (2013-04-14 22:45:28 UTC) #12
dave_cheney.net
On 2013/04/14 22:08:24, thumper wrote: > On 2013/04/12 23:43:09, dfc wrote: > > not lgtm. ...
11 years ago (2013-04-14 23:14:39 UTC) #13
dave_cheney.net
LGTM. I can't give a crap about namespace bikeshedding.
11 years ago (2013-04-14 23:42:13 UTC) #14
thumper
*** Submitted: Create a classic set for strings. I got sick of the map[string]bool fluffing ...
11 years ago (2013-04-14 23:49:46 UTC) #15
rog
11 years ago (2013-04-15 10:42:50 UTC) #16
On 14 April 2013 23:45,  <tim.penhey@canonical.com> wrote:
> Actually I did briefly consider this and discarded it.  The purpose of
> the opaque type is to hide the data, not make it available.

YAGNI. a map is already an opaque type - there's all kinds of magic
buried beneath.
i don't believe there's any value in making this an opaque type.

BTW we should really have a way of iterating over this type without
copying all its items into a new slice.
Sign in to reply to this message.

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