Improving std.algorithm.find

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jul 19 19:18:03 PDT 2010


On 07/19/2010 06:36 PM, sybrandy wrote:
>> I think that the problem with find() is not so much find() but it's
>> documentation.
>> In all honesty, anything with a return type like FindResult!(Range,
>> Ranges) is
>> going to scare people off.
>
> I fully agree. I had no idea from the documentation what something like
> this was: [1,2,3,4][]. The array documentation doesn't have any details,
> so for the most part I've stayed away from std.algorithm because I don't
> understand the return types very well. Better documentation would help a
> lot.

I agree as well. FWIW [1, 2, 3, 4][] is a workaround for a (now gone) 
bug in the compiler. That bug made [1, 2, 3, 4] a fixed-size array by 
default.

I'll work on improving the documentation.


Andrei



More information about the Digitalmars-d mailing list