You've made it type safe by providing the comparer, so you may as well go the whole way and stop people doing the wrong thing. If there are things that are worth exposing, expose them explicitly.
--
afk
Dan
From: Brent Pedersen
Sent: Tuesday, 14 February, 08:30
Subject: Re: [biogo-user] interval set operations
To: Dan Kortschak
Cc: biogo...@googlegroups.com
You mean instead of naming it, like: type RangeSet struct { v *step.Vector } ? I guess originally, I was thinking the user might want to access some of the public methods from the step.Vector. On Mon, Feb 13, 2017 at 2:51 PM, Dan Kortschak wrote: > Is there a reason to have the step vector embedded anonymously? > > On Mon, 2017-02-13 at 14:22 -0700, Brent Pedersen wrote: >> I ended up with this: https://godoc.org/github.com/brentp/rangeset >> embedding step.Vector >> >> On Mon, Feb 13, 2017 at 10:18 AM, Brent Pedersen >> wrote: >> > >> > Great! So, does this seem reasonable for Intersection of multiple >> > *step.Vector >> > >> > https://gist.github.com/brentp/4419f6711917096bce83e7eddb648c85 ? >> > >> > Or is there a more efficient (in LOC or CPU) way? >> > If this is generally close, then having a Vector.Clone() method >> > would >> > be convenient. >> > >> > thanks, >> > -Brent >> > >> > On Sat, Feb 11, 2017 at 9:18 PM, Dan Kortschak >> > wrote: >> > > >> > > Ahh, OK. biogo/store/step will do that for you. >> > > >> > > On Sat, 2017-02-11 at 21:11 -0700, Brent Pedersen wrote: >> > > > >> > > > I mean a set where e.g. I can union (1, 9) and (7, 14) and it >> > > > will >> > > > give (1, 14) and then I can subtract (5, 8) and get (1, 5), (9, >> > > > 14)