At 09:42 AM 7/17/2008, Alan Knight wrote:
At 07:57 AM 7/17/2008, Holger
Kleinsorgen wrote:
> Ahhh, very nice catch
indeed. We do have a somewhat related AR,
>
>
AR#
46540
>
Description
SortedCollection>>includes:/indexOf: binary search
>
> which implements binary search / binary inclusion checks for
sorted
> collections. Note that this functionality is not meant to
replace what
> includes: / indexOf: are doing right now, but rather they provide
this
> via new selectors.
may I ask why? Interval didn't implement #includes: in the past, too,
until a specific implementation was added in 7.6 (43789). This was nice,
because all senders automatically benefited from the
improvement.
This came up quite some time ago, and I can't seem to find the reference,
but John Brant quite extensively pointed out the issues with includes:
using binary search being difficult or impossible to reconcile with the
ANSI standard behaviour. That's unfortunate, and arguably a bug with
ANSI, but it does seem to make it inadvisable to make that the default
implementation. It also does mean (if the methods are available) that you
can deliberately invoke binary searches on collections that you happen to
believe are sorted, even if they aren't strictly sorted collections.
OK, I found it. In comp.lang.smalltalk, September 2003, with the
rather unrelated subject line "Re: ST standardization: (was Re: Is
Python's library more standard than Smalltalk's?) "
--
Alan Knight [|], Engineering Manager, Cincom Smalltalk
_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc