On Thursday, 18 October 2018 21:51:35 UTC+2, robert engels wrote:
>
> I guess I don’t understand the problem with using “method names” e.g. 
> Less() in generic code - yes it is a little more verbose - but it avoids 
> the traditional problems with operator overloading leading to obtuse code. 
>
> The issue that has not been raised yet, but is bound to come up, is that 
operators compose into expressions whereas methods have a much simpler, 
much more restrictive composition paradigm. Add operator precedence to the 
mix and stand well back.

I frankly prefer methods to operators, but the need here is to retain the 
features of operators within generics and that means dealing with 
precedence as well as conversion, not just within the arithmetic realm, but 
specially across the operation, like when == transforms practically any 
compatible operands to a boolean result.

Just adding my two cents of accelerant to a flammable mixture. Feel free to 
point out, if applicable, that I'm off topic and, specially instructive, 
why. But make it simple, there has been quite a bit written here I don't 
think I'll ever get my head around.

Lucio.

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