Dlang Features You Would Like To Share
Dukc via Digitalmars-d
digitalmars-d at puremagic.com
Thu Apr 13 06:04:20 PDT 2017
On Thursday, 13 April 2017 at 11:16:46 UTC, crimaniak wrote:
> If fact you don't need any template to do this. Try the next:
>
> foreach(i; 1 .. 11)
> { foreach(j; 1 .. 11) write((x => x*x)(i * j), " ");
> writeln;
> }
True, that's a good trick too. But I prefer the template at least
sometimes because I ususally construct the argument up first and
only then start to think about what function to call. With the
use template, I can write and read in order I think -Exactly the
reason why UFCS rules in my opinion.
More information about the Digitalmars-d
mailing list