The Expressive C++17 Coding Challenge in D

Martin Tschierschke mt at smartdolphin.de
Wed Feb 14 09:45:09 UTC 2018


On Tuesday, 13 February 2018 at 23:35:36 UTC, Seb wrote:
> Someone revived the Expressive C++17 Coding Challenge thread 
> today and I thought this is an excellent opportunity to revive 
> my blog and finally write an article showing why I like D so 
> much:
>
> https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d
>
> It's mostly targeted at beginners as I explain many basic D 
> features, but maybe it's helpful for beginners looking into D.

Very nice read!!! Thank you!


One "typo?" Chapter 8)

>same format function that would normally be called at 
>compile-time
  s/compile/run/

It would be good to say a little more about the '!' ct-parameter

At fist when reading D code coming from ruby (after, 
php,...C++,C, Pascal...),
I thought, that the ! is like in Ruby just an way to distinguish 
between a function modifying the contend or not (compare gsub to 
gsub!) it took sometime before this important bit came clear to 
me.
So just something, like functions in D may have two parameter 
brackets:
One for compile-time and one for run-time parameters:
fun!(ctParam)(rtParam) ... short fun!(cParam)() ... fun!ctparam

Other point:

Showing some more alternative D solutions for the same problem, 
might be a little contest in this thread, just post your shorter 
and better solutions :-)



More information about the Digitalmars-d-announce mailing list