Do sorted ranges have any special properties?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Tue Jul 27 09:59:00 PDT 2010
Jonathan M Davis wrote:
> On Tuesday, July 27, 2010 07:05:11 Andrei Alexandrescu wrote:
>> This all raises the question: where should this Sorted(R) in the making
>> go? It's a range so it should go in std.range, but it's mostly a
>> motivator for algorithms, so it should go in std.algorithm. Tiebreakers?
>
> It's a range, so put it in std.range. It's already likely pretty common to be
> importing both anyway, and std.algorithm has more in it than std.range at this
> point. Sure, it may be used with std.algorithm, but someone may have their own
> functions that they'd want to use it with without std.algorithm.
>
> I suppose that it is a bit borderline as to which module it should go in, but
> I'd argue that since it's a range that isn't associated with any particular
> function (like Find! or Until! or whatnot), it should go in std.range.
I agree with the argument. I just fear that someone wants binary search,
searches the std.algorithm document for "binary", doesn't find any, and
concludes it doesn't exist. I think I should drop such names as
"binarySearch", "lowerBound" etc. in the documentation of std.algorithm
and have the terms xref to std.range.
Andrei
More information about the Digitalmars-d
mailing list