What functions could be added to std.algorithm?

Steven Schveighoffer schveiguy at yahoo.com
Mon Aug 2 06:36:39 PDT 2010


On Mon, 02 Aug 2010 09:11:32 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 08/02/2010 06:11 AM, Steven Schveighoffer wrote:
>> On Sun, 01 Aug 2010 17:34:46 -0400, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> I agree that all of the functions you suggested deserve a place in
>>> std.algorithm (or std.range). Please add one bugzilla entry or better
>>> yet let me know if you'd like to join Phobos's devs (subject to team
>>> approval) so you can add them yourself.
>>>
>>> Also, I agree that std.algorithm has gotten a bit large. Any sensible
>>> ideas for addressing that should be discussed. Off the top of my head,
>>> I'm thinking that mutators vs. non-mutators could be a possible
>>> criterion for separation.
>>
>> This doesn't matter too much. Parsing std.algorithm is quick by the
>> compiler, and all of std.algorithm is templates.
>>
>> The bigger issue is the documentation. D has been very stagnant in
>> improving the doc generator. We are missing a global function/symbol
>> index, cross-linked docs, and many other goodies that have been in
>> systems like doxygen since its inception.
>>
>>>
>>> BTW, it warms my heart to see that our std.algorithm is the fourth
>>> Google hit when searching for std::algorithm (or std.algorithm, which
>>> seems to produce the same results). I feel std.container can be a
>>> similarly compelling offering. *cough*RBTree*cough*Steve*cough*
>>
>> Yeah yeah :) My spare-time priorities:
>>
>> 1. New Minivan
>> 2. Getting baby's room ready
>> 3. Cleaning rest of house
>> 4. Completing RBTree for you
>>
>> ;)
>
> New baby? Congratulations!

Thanks!

> (Who said the D community isn't growing?) And yes, you're excused :o).  
> In fact I'll use with credit the code you'd already sent me, only  
> unittests are missing, which I can add myself.

That would be good.  I can add more later if I find some dcollections unit  
tests that cover more than what you add.  Indirectly, the code should be  
well-tested since the RB algorithm is copied verbatim from dcollections  
which has full unit-tests.

Before you do so though, I think I have a more updated version which  
includes lowerBound and upperBound fixed (and equalRange added).  I'm not  
sure if I sent that to you, I'll send it now.

I also started with one unittest copied from dcollections.

Also note the docs aren't really Phobosified, I've not yet learned how the  
phobos docs work.

>
> Andrei
>
> P.S. A couple of friends of mine swear by Honda Odyssey. In fact, one of  
> them owns two.

My parents have one, and we will have one shortly :)

-Steve


More information about the Digitalmars-d mailing list