forum-msg-id-124621-edit

Original date:2014-06-15 14:56:58 Edited by: petelomax Subject: Re: binary search with reference to append

DerekParnell said...

I think that if we were writing this function for inclusion into the library now, we would not have these optional parameters. In hindsight, they are probably a poor design decision. But here we are ... we are stuck with them.

It seems perfectly reasonable to me, if everyone else agrees, to remove them. Of course that would be with a suitable entry in the release notes and both the manual and bsearch.e containing something like

-- Compatibility Note: 
--  Prior to 4.2 bsearch() allowed the start and end points to be specified. This was agreed to be removed (http://openeuphoria.org/forum/124592.wc),  
--   if necessary replace eg res = bsearch(needle,haystack,5,10) with res = bsearch(needle,haystack[5..10]), remembering add 4 to abs(res). 

Obviously, that is, if appropriate code changes to manage without them do not adversely affect the performance of next_prime().

Pete

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu