News for hackers. Stuff that matters.
Re:Is Go Duck-Typed? by seertaak on Thursday March 05, 2020 @12:20AM (#22491168)
Thanks for clarifying that; I was actually aware of the link to syntactic sugar and it's probably true that you want to control that independently. After all, who doesn't want to hijack unary minus for the purpose of as hackneyed rendering of EBNF? C++ certainly does it :)

Anyway a serious answer to your comment would be to create a field or ring concept. This would unify some or all of the arithmetic operations.

A neat bonus would be the ability to overload the one and zero literals for the set. So in field of nxn matrices on real numbers 0 is the zero matrix and 1 is the identity.

Re:Is Go Duck-Typed? by steveklabnik on Thursday March 05, 2020 @10:10AM (#22494106)
> After all, who doesn't want to hijack unary minus for the purpose of as hackneyed rendering of EBNF?

Ha!

> Anyway a serious answer to your comment would be to create a field or ring concept.

Yeah, this is true. We really, really struggled to create a set of traits for numerics, even regardless of these more advanced ideas... so it's unclear this would work. But it's certainly closer than I had thought :)