More on semantics of opPow: return type

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Dec 7 14:30:26 PST 2009


Lars T. Kyllingstad wrote:
> The fundamental reason why I want opPow so badly is in fact not even how 
> often I use it. If that was the case, I'd want a special "writefln" 
> operator as well. The main reason is that exponentiation is such a basic 
> mathematical operation, right up there with addition and multiplication, 
> that it deserves an operator of its own.

Hmmm. Addition, subtraction, multiplication, and division with remainder 
are all closed over integers. Power isn't. It's not even closed over 
real numbers. That makes it quite special and quite non-basic.

The more I hear, the more I'm convinced ^^ is just not worth it. And 
again: I initially liked the idea.


Andrei



More information about the Digitalmars-d mailing list