j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Came across a quirk in the behavior of the #addAll: for SortedCollections. If you run the following snippet, you should get a different kind of result for the return value of the message than you do for any of the other standard collections.
| x y | x := #(1 2 3) asOrderedCollection. y := x addAll: #(7 8 9). "returns #(7 8 9)" Transcript show: y printString; cr.
x := #(1 2 3) asSortedCollection. y := x addAll: #(7 8 9). "returns Sorted Collection (1 2 3 7 8 9)" Transcript show: y printString; cr.
I ran the code under VW, and in both instances it returns the array that is being added, not the overall collection. Looking at the implementation of #addAll: method for SortedCollection, it appears that no value is explicitly returned. Not an earth shattering quirk, but perhaps it should be looked at.
squeak-dev@lists.squeakfoundation.org