Overloading relational operators separately; thoughts?
bachmeier via Digitalmars-d
digitalmars-d at puremagic.com
Fri Sep 30 12:46:35 PDT 2016
On Friday, 30 September 2016 at 01:07:49 UTC, Chris Wright wrote:
> The perl example is a line of code buried somewhere that
> changes the meaning of the rest of the code. Operator
> overloading is restricted to a specific user-defined type. With
> such a dramatic difference in the scope of the change, the
> analogy is useless.
I was responding to someone that wrote: "I also have the presence
of mind to recognize that my opinions are not universal, and they
are certainly no basis for imposing arbitrary limits upon another
person's behavior". I gave an example of what happens when you
don't want "arbitrary limits".
Claiming that operator overloading only applies to a specific
user-defined type makes it worse. Having it work one way for
three types, a different way for four other types, and a third
way for yet another type doesn't sound like a minor thing.
But have fun debating design decisions that were made long ago
and aren't going to change.
More information about the Digitalmars-d
mailing list