Marcel Taeumel uploaded a new version of Collections to project The Trunk: http://source.squeak.org/trunk/Collections-mt.1057.mcz
==================== Summary ====================
Name: Collections-mt.1057 Author: mt Time: 4 December 2023, 10:38:49.326721 am UUID: 3da620a5-90b9-f542-b1ab-6785eda55837 Ancestors: Collections-ct.1056
Update elements-printing for hashed collections, i.e., bags, sets, dictionaries: - For bags, choose the more compact way that dictionaries do - For sets, sort contents like dictionaries do for keys - For dictionaries, drop that trailing space
Thanks to Christoph (ct) for the ideas!
=============== Diff against Collections-ct.1056 ===============
Item was added: + ----- Method: Bag>>printElementsOn: (in category 'printing') ----- + printElementsOn: aStream + "Pass request to internal contents dictionary to re-use its printString representation, which exposes (more compact) item counts and not a raw element list." + + contents printElementsOn: aStream.!
Item was changed: ----- Method: Dictionary>>printElementsOn: (in category 'printing') ----- printElementsOn: aStream aStream nextPut: $(. self size > 100 ifTrue: [aStream nextPutAll: 'size '. self size printOn: aStream] ifFalse: [self keysInOrder do: [:key | aStream print: key; nextPutAll: '->'; + print: (self at: key)] + separatedBy: [aStream space]]. - print: (self at: key); - space]]. aStream nextPut: $)!
Item was added: + ----- Method: Set>>printElementsOn: (in category 'printing') ----- + printElementsOn: aStream + "Like dictionaries, indicate some human-readable sort order." + + self sortedSafely printElementsOn: aStream.!
packages@lists.squeakfoundation.org