The Inbox: Collections-cmm.859.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Collections-cmm.859.mcz

commits-2
Chris Muller uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-cmm.859.mcz

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

Name: Collections-cmm.859
Author: cmm
Time: 5 November 2019, 5:07:01.58164 pm
UUID: 19f1d9b4-08e4-454d-9fe3-6015e80dd233
Ancestors: Collections-pre.857

Let OrderedDictionary print its elements in its own sequence.

=============== Diff against Collections-pre.857 ===============

Item was added:
+ ----- Method: Dictionary>>keysInOrder (in category 'accessing') -----
+ keysInOrder
+ "Answer the keys of the receiver in a particular sequence.  This default is alphabetical, but subclasses like OrderedDictionary maintain their own sequence."
+ ^ self keysSortedSafely!

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
- ifFalse: [self keysSortedSafely
  do: [:key | aStream print: key;
  nextPutAll: '->';
  print: (self at: key);
  space]].
  aStream nextPut: $)!

Item was added:
+ ----- Method: OrderedDictionary>>keysInOrder (in category 'accessing') -----
+ keysInOrder
+ "Overridden.  Preserve the order of the receiver."
+ ^ self keys!