ch-ch-update: series, closed-form series, and strides

Sean Kelly sean at invisibleduck.org
Sat Jan 31 12:17:40 PST 2009


bearophile wrote:
> Andrei Alexandrescu:
>> foreach (e; take(10, fib)) writeln(e);
> 
> I think take(fib, 10) is quite better.

I like function calls that read like a sentence.  Here I'd read take(10, 
fib) as "take 10 from fib".  The only advantage of reversing the 
arguments is that it might decompose well into the property syntax: 
fib.take(10).


Sean



More information about the Digitalmars-d mailing list