« Return to Thread: [vwnc] Bug in MethodDictionary

Re: [vwnc] Bug in MethodDictionary

by Alan Knight-2 :: Rate this Message:

Reply to Author | View in Thread

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.

--
Alan Knight [|], Engineering Manager, Cincom Smalltalk
knight@...
aknight@...
http://www.cincom.com/smalltalk

_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

 « Return to Thread: [vwnc] Bug in MethodDictionary

LightInTheBox - Buy quality products at wholesale price!