On Sun, Sep 9, 2018 at 6:51 AM, Ignazio Di Napoli <neclep...@gmail.com> wrote:
>
> Thank you, I see your point. This is less powerful than contracts, but Go 
> proved me that less is more, as long as it is enough. My point is: do we 
> really need a so powerful version of generics or maybe operators and 
> interfaces are enough?
>
> For the many keywords added and to manage conversions, we could add just add 
> the keyword "operator":
>
> type MyInterface (type T) {
>     operator +(T, T);
>     operator float64(T);
>     operator T[int] string;
> }
>
> Of course with this approach we have to take operator overloading in, and 
> it's much more than what is now in the proposal (maybe contradicting my 
> initial statement).

I encourage you to work through all the examples in the generics
design draft and consider whether and how they can be written with
this suggestion.  Thanks.

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