range chunks

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Aug 6 18:51:37 PDT 2010


On 08/06/2010 06:52 PM, bearophile wrote:
> Philippe Sigaud:
>>> It's better to give it a default chunk size of 2.
>>
>> Why?
>
> I'm using partition() for years in various languages, and I've seen that the chunks of size 2 are the most common.
>
>
>> And what should the default step be, according to you? If chose n (the chunk
>> size), because that's want the OP wanted.
>
> No duplication across chunks, so on default it can split the natural numbers as:
> [1, 2], [3, 4], [5, 6], etc.
>
>
>> Yeah, partition, chunk, segment, it a basic thing, worth including in
>> std.range.
>
> The most common name is partition().

When I see "partition" I think it's quicksort's partition algorithm...

Andrei


More information about the Digitalmars-d mailing list