D dropped in favour of C# for PSP emulator

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri May 18 14:28:43 PDT 2012


On 5/18/12 4:11 PM, Peter Alexander wrote:
> On Thursday, 17 May 2012 at 19:19:04 UTC, Andrei Alexandrescu wrote:
>> On 5/17/12 11:52 AM, Peter Alexander wrote:
>>> On Thursday, 17 May 2012 at 15:26:19 UTC, Andrei Alexandrescu wrote:
>>>> I agree binarySearch is more precise, but I also think it's a minor
>>>> issue not worth the cost of changing at this point. Improving names of
>>>> things in the standard library is a quest that could go forever, make
>>>> everybody happy we're making progress, and achieve no substantial gain.
>>>
>>> No need to change anything, just add something:
>>>
>>> bool binarySearch(Range, Value)(Range range, Value value)
>>> {
>>> return assumeSorted(range).contains(value);
>>> }
>>>
>>> (constraints, predicates and the myriad of qualifiers/decorations
>>> omitted for clarity).
>>
>> I don't see much benefit in this - just lateral walking. As long as
>> the keyphrase "binary search" is present in the documentation, that's
>> all that's needed as far as newcomers discoverability is concerned.
>
> It's not just for newcomers discoverability, it's also for readability.
> Reading the assumeSorted version, it's not clear that a binary search is
> done.

I guess it is now :o).

Andrei


More information about the Digitalmars-d mailing list