[squeak-dev] The Inbox: Collections-pre.838.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 28 10:11:22 UTC 2019


Patrick Rein uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-pre.838.mcz

==================== Summary ====================

Name: Collections-pre.838
Author: pre
Time: 28 June 2019, 12:11:16.302033 pm
UUID: db29f1b2-09b5-f045-aa21-9379185664df
Ancestors: Collections-pre.837

Two method additions to Collection. The first adds ordered printing to OrderedDictionaries, to allow users to actually see the ordering. The second adds a method to convert a run array into an expanded version of the runs.

=============== Diff against Collections-pre.837 ===============

Item was added:
+ ----- Method: OrderedDictionary>>printElementsOn: (in category 'printing') -----
+ printElementsOn: aStream 
+ 	"Based on Dictionary>>#printElementsOn:"
+ 	
+ 	aStream nextPut: $(.
+ 	self size > 100
+ 		ifTrue: [aStream nextPutAll: 'size '.
+ 			self size printOn: aStream]
+ 		ifFalse: [order do: [:assoc | assoc ifNotNil: [
+ 					assoc printOn: aStream. aStream space]]].
+ 	aStream nextPut: $)!

Item was added:
+ ----- Method: RunArray>>asValuesAndIntervals (in category 'converting') -----
+ asValuesAndIntervals
+ 
+ 	| interval result |
+ 	result := OrderedDictionary new.
+ 	1 to: self size do: [:i |
+ 		(self at: i) do: [:value |
+ 			interval := result at: value ifAbsentPut: (i to: i).
+ 			result at: value put: (interval start to: i)]].
+ 	^ result
+ 	!



More information about the Squeak-dev mailing list