On Fri, Oct 19, 2018 at 10:38 AM Eric S. Raymond <e...@thyrsus.com> wrote: > > Ian Denhardt <i...@zenhack.net>: > > I feel like Burak's proposal is falling into the same trap as many others: > > there is a common feeling that operator overloading is a Pandora's box, so > > folks are trying to work around it by solving the problem without providing > > operator overloading. But *the problem itself* is not being able to abstract > > over operators, so this approach is doomed to failure. You just result in a > > clumsy design that can't decide if it's trying to allow operators to be > > abstracted over or not, since the whole point is to allow this, but the > > particulars of the design are motivated by a fear of actually doing so. > > > > I there is a fundamental conflict here. You can express the same concepts > > as with operator overloading if you're willing to wrap the basic types and > > use > > methods like .Less() in generic code. But I think fundamentally folks have > > to > > make choice: do we want to be able to write `<` for user defined types, or > > do > > we want to be able to look at the `<` operator and know for certain that > > it's > > not calling a method? You can't have both. > > Ian has just unpacked my "unwelcome conclusion" very nicely. This is > *exactly* > the insight that led me to design "implements". > > This is why I confidently predict that nobody will find a simpler way > to approximate contracts than "implements". Ever. (In particular, > Burak's way is, though clever and interesting, not simpler.) Because > "implements" is the dead bare minimum expression of abstracting over > operators; anything else you do to go near that has to be more > complicated and roundabout.
Where can I read about this "implements"? Link? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.