Short list with things to finish for D2

lws invalid at email.com
Mon Dec 14 22:17:52 PST 2009


On 2009-11-19 15:46:57 -0800, Bill Baxter <wbaxter at gmail.com> said:

> On Wed, Nov 18, 2009 at 8:33 PM, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
> 
>> I am thinking that representing operators by their exact token
>> representation is a principled approach because it allows for unambiguous
>> mapping,
> 
> There used to be an argument floating around that using 'opAdd" was
> better than "op+" because the former encourages people to only
> overload the method to do things that resemble addition.  Whereas op+
> says I'm just a symbol, do whatever you want with me.
> 
> I never really bought into it... but it was what I was told years ago
> when I complained that opSub opMul etc were harder to remember than
> need be. :-)
> I guess D will have to change it's story now.
> 
> --bb

The reason Walter provided me when I asked ~9 years ago was that "T 
operator+(T)" causes unnecessary headaches when parsing.  opAdd does 
not produce these complications when parsing function declarations.

T opBinary(string op)(T) also does not produce the same headaches.

-SC




More information about the Digitalmars-d mailing list