A nice way to step into 2012

Marco Leise Marco.Leise at gmx.de
Wed Dec 28 04:30:53 PST 2011


Am 27.12.2011, 16:11 Uhr, schrieb Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org>:

> On 12/27/11 4:51 AM, deadalnix wrote:
>> Le 27/12/2011 05:25, Andrei Alexandrescu a écrit :
>>> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>>>
>>>
>>>
>>> Andrei
>>
>> Maybe I'll seem bitter, but I do not think this changement was really
>> that important. This is nice, ok, but we have some other really serious
>> flaw, like shared not doing what it is supposed to do.
>
> Imagine how bitter I am that the string lambda syntax didn't catch on!
>
> Andrei

I used it and I am not sure if it had draw backs, but looking at the code  
to support them, it gave me the feeling that you were doing part of the  
job, the compiler should be doing: test if the alias is a string, if it  
can be compiled and assigning variable names to parameters. I once adapted  
that style to write something similar to binaryFun and the algorithm  
templates. It worked for me after a while, but I found it a bit  
complicated. (Before D, I only used templates as far as generic types go.)  
The source code didn't *look* exactly concise and going with the language  
to me, if you know what I mean. It shows a nice capability of the language  
- maybe the first time newbies stumble over mixin string, but a short  
lambda syntax is as good (because the string mixin doesn't get us anything  
beyond that) and saves the if-else to identify the kind of alias and the  
support code. Honestly, I never really liked the idea of string mixins for  
general use :D like saving on boilerplate code, multi-inheritance etc. It  
may seem odd, but I prefer a dozen language features over one string mixin  
feature that can cover them all.
That brings me to another point: I like to use IDEs and they must have  
difficulties in understanding string mixins and giving hints. There are no  
rules to what you can put in a string, but a lambda syntax defined in the  
specification can be checked in the IDE.


More information about the Digitalmars-d mailing list