Blog post: What D got wrong

Simen Kjærås simen.kjaras at gmail.com
Tue Dec 11 15:34:28 UTC 2018


On Tuesday, 11 December 2018 at 14:38:25 UTC, Steven 
Schveighoffer wrote:
> On 12/11/18 5:45 AM, Atila Neves wrote:
>> A few things that have annoyed me about writing D lately:
>> 
>> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/
>
> Agree with most of this. UFCS for templates would be awesome, 
> but the syntax is trickier, since instantiation uses ! instead 
> of .
>
> I can't see how you get around the ambiguities, especially when 
> a template could be a UFCS function.

I believe a reasonable case can be made for .! for UFCS - it's 
currently invalid syntax and will not compile, and ! is the 
symbol we already associate with template instantiation:

alias memberFunctions = __traits(allMembers, T)
     .!staticMap!Member
     .!Filter!(isSomeFunction);

--
   Simen


More information about the Digitalmars-d-announce mailing list