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

Also, I agree with Eric that the Go team always surprised me for the elegance 
of their work and I'm sure they will provide a better solution than what I 
could think. I'm just surprised of the overlap between contracts and 
interfaces, at least as I understand them... It seems to me to break that 
elegance.

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