The stately := operator feature proposal

Diggory diggsey at googlemail.com
Wed May 29 19:51:40 PDT 2013


On Thursday, 30 May 2013 at 01:35:58 UTC, MrzlganeE wrote:
> Diggory:  That's very cool -- being able to do that in D. 
> Thanks for showing me :)
>
> But it is not even a remotely practical solution.
>     The idea is to write less, and so the solution you've given 
> is to write more mixins all over the place. I said I don't even 
> want to write 'auto', I am surely not writing the big mixin 
> chunk.
>
> I only gave an example of math stuff.
> But I'd use := for the non-math stuff too.
>
> I want := it to be available everywhere.
> Even if I am just typing a snippet into dpaste.
>
> If D implements this, C++ will try to copy it 10 years later.
> It's a futuristic thing -- what is old is new.

The mixin definition only needs to exist once, and you can use 
"mixin" anywhere - you could wrap an entire source file in it:

mixin!q{

/* All of your code */

}


More information about the Digitalmars-d mailing list