The stately := operator feature proposal

Timothee Cour thelastmammoth at gmail.com
Wed May 29 20:02:39 PDT 2013


mixins make the code more ugly and the error messages' line numbers will
not be in sync with the code, IIRC.
I would like this syntax sugar too.

It's also used in GO, btw.

On Wed, May 29, 2013 at 7:52 PM, Diggory <diggsey at googlemail.com> wrote:

> On Thursday, 30 May 2013 at 02:51:47 UTC, Diggory wrote:
>
>> 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 */
>>
>> }
>>
>
> *mixin Math!q{ ... };
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130529/e8658228/attachment.html>


More information about the Digitalmars-d mailing list