Comment #1 on issue 2841 by [email protected]: Heap equality should be
transitive
http://code.google.com/p/pharo/issues/detail?id=2841
If I download the code from Squeak trunk, it will break a lot of tests in
HeapTest.
(only due to the fact that I remove #species).
I believe that assumptions made about Heap are not right.
I wonder why the Heap should be considered as Sequenceable.
Elements are partially sorted and the structure is more of a binary tree.
Elements are not fully sorted, thus the order:
- is not the order of the addition of elements,
- is not independent of the order of addition.
In fact, only the Heap head (first) is meaningfull.
Thus testing some properties like #beginsWith: #endsWith: #at: #at:put:
#reversed #copyFrom:to: etc... seems very fragile to me.
Of course, that would mean moving the Heap one level up, directly under
Collection, in order to cease undue inheritance of sequenceable API.
What do you think ?