D dropped in favour of C# for PSP emulator

H. S. Teoh hsteoh at quickfur.ath.cx
Thu May 17 09:40:54 PDT 2012


On Thu, May 17, 2012 at 10:26:18AM -0500, Andrei Alexandrescu wrote:
> On 5/17/12 4:00 AM, Peter Alexander wrote:
[...]
> >I'd have to read the documentation to find out which of these uses
> >binary search. In fact, I'd probably have to read the Phobos source.
> >
> >If I just used binarySearch then I would be 100% guaranteed that it
> >will use a binary search. I don't have to second guess the compiler
> >-- I just *know*.
> 
> 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.
[...]

Why not just add something like this then:

	E binarySearch(R,K)(R range, K key)
	{
		return assumeSorted(range).contains(key);
	}

Nobody says we have to change the names of existing code. Adding a
wrapper with a nice name works just fine, and doesn't break any existing
code, etc..


T

-- 
Who told you to swim in Crocodile Lake without life insurance??


More information about the Digitalmars-d mailing list