"David" == David N Smith (IBM) <David> writes:
David> I can't believe it will always work identically, but I've not been David> able to come up with a test case that fails. (I implemented a version David> if #includes: that is simply:
David> includesP: aValue David> ^ self asArray includes: aValue
David> and used it for comparison. This IS a precise and accurate solution, David> though it might run out of memory at inconvenient times and otherwise David> misbehave when the interval has lots of elements.
You could even do this:
includesP: aValue self do: [:each | each = aValue ifTrue: [^true]]. ^false
That won't ever run out of memory. Unless you got one of those open-ended Interval's. :)
Hey wait, that's the definition in Collection!
Geez, didn't I say this a few months ago?
Interval|includes: is broken, and should simply be removed. If you want an optimization for integer step classes, be sure to call super|includes: when it's not one of those. Otherwise, just delete the message entirely, and let it fall from Collection.
It all comes full circle. :)
squeak-dev@lists.squeakfoundation.org