Cool features of the D language
Philippe Sigaud
philippe.sigaud at gmail.com
Sun May 13 05:49:46 PDT 2012
> On 5/12/2012 4:56 PM, "Michaël Larouche" <michael.larouche at gmail.com>"
Nice article Michaël! And thanks for the link to Pegged.
About UFCS, I played with it this week and discovered it makes for
some nice user code with a unit module (as in 'SI units', not
'unittests'):
auto speed = 100.miles/hour; // <-- Looks quite natural, isn't it?
auto distance = 350.km;
writeln("time to destination: ", (distance/speed)/hour);
Not something essential in this case, but definitely nice to have. I
think templates+UFCS will give us really nice API's.
Philippe
More information about the Digitalmars-d
mailing list