The reason I'm trying to keep things separate (at least in my head) is that
it allows to split the implementations. For example, it would be possible
to first add type-parameters, then add constraints (however) and then add a
way to allow constraints enabling operators (however). Each step would be
useful in and off itself and allow us to observe what kind of code people
write using it and decide if and how we want to move forward. And
experiences with the earlier steps might inform the design of later steps.

I agree that we should still keep all the steps in mind when talking about
this, but I feel that not considering one part of the chain just because it
doesn't fully imply the others is premature. YMMV of course. I still trust
that there will be a good design coming out of this one way or another :)

On Sun, Sep 9, 2018 at 9:29 PM Ian Lance Taylor <i...@golang.org> wrote:

> On Sun, Sep 9, 2018 at 12:18 PM, 'Axel Wagner' via golang-nuts
> <golang-nuts@googlegroups.com> wrote:
> >
> > I disagree with the premise that we need operators for generics - when I
> > think of "generics", I usually think of "type-safe, constrained,
> parametric
> > polymorphism". Without operators, generic code would still fulfill that
> > definition. I agree that being able to use operators would make generics
> far
> > more convenient and require less boilerplate. And I agree that that
> means we
> > probably want to have them for generic code. But saying they are
> > fundamentally needed IMO over constrains the design space.
>
> It does constrain the design space, but, as I've said elsewhere, I
> believe that an implementation of generics that does not let us write
> the Min or Contains functions would be laughed out of court.  Of
> course Min and Contains don't have to use the same mechanism as that
> supporting type-safe parametric polymorphism, but they do have to
> exist one way or another.
>
> Ian
>

-- 
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.

Reply via email to