A possible solution for the opIndexXxxAssign morass

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Oct 14 07:31:06 PDT 2009


Don wrote:
> Well timed. I just wrote this operator overloading proposal, part 1.
> http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP7
> I concentrated on getting the use cases established.

I'm not sure multiplication is generally commutative (e.g. in linear 
algebra it isn't). So why should a * x be interchangeable with x * a?

Also, the much-discussed identity:

x @= y	<-->	x = x @ y

is difficult to enforce statically in practice. I think some types would 
want to define both to achieve good efficiency. It would be hard for the 
compiler to render one unnecessary or to prove that the two are equivalent.


Andrei



More information about the Digitalmars-d mailing list