[squeak-dev] self copyEmpty better than self species new [was: Why is Heap>>#species => Array?}

Klaus D. Witzel klaus.witzel at cobss.com
Thu Feb 21 22:20:20 UTC 2008


On Thu, 21 Feb 2008 22:19:43 +0100, nicolas cellier wrote:

...
>
> opened http://bugs.squeak.org/view.php?id=6943 for this one

Well, hm, I have as yet not thought about the subject line in that report.

But now I think that Heap #species problem is more subtle: (self species  
new) cannot pass the sortBlock of Heap (nor any other clone-invariant  
instVar) for users like #collect: and friends; therefore Array is passed  
by Heap #species.

But #copyEmpty can pass sortBlock and *whatsoever* to clones ;-) With  
#copyEmpty in place of (self species new), sending #species would be  
mainly in support of #= and #copyEmpty, throughout the collection  
hierarchy.

BTW hey Traits guys, did you discover something like the above during your  
reengineering of the collection hierarchy, that would be interesting to  
know !

>
>





More information about the Squeak-dev mailing list