ch-ch-update: series, closed-form series, and strides
grauzone
none at example.net
Sat Jan 31 05:49:43 PST 2009
Ary Borenszweig wrote:
> Andrei Alexandrescu escribió:
>> bearophile wrote:
>>> Andrei Alexandrescu:
>>>> foreach (e; take(10, fib)) writeln(e);
>>>
>>> I think take(fib, 10) is quite better.
>>> I presume the API of those things will need about a year of usage to
>>> become refined.
>>>
>>> Bye,
>>> bearophile
>>
>> SPJ held a gun to my head and said: "take(10, fib)".
>
> Who is SPJ?
>
> I find "take(10, fib)" more readable: take 10 from fib. Same order.
I prefer the other way around.
There's another argument for take(fib, 10) that isn't just about taste:
if fib was an array, you could write fib.take(10).
Weren't there discussions to allow a.F(b...) for F(a,b...) in general?
More information about the Digitalmars-d
mailing list