我试图OrderedCollection
通过它的键对一个进行排序,但这个方法只返回键。我想同时获取键和值,但根据键进行排序。
aAssociation:= Association new.
aAssociation key:6 value:7.
aOrderedCollection:= OrderedCollection new.
aOrderedCollection addFirst: aAssociation.
aAssociation1:= Association new.
aAssociation1 key:5 value:9.
aOrderedCollection addLast: aAssociation1.
aAssociation2:= Association new.
aAssociation2 key:8 value:4.
aOrderedCollection addLast: aAssociation2.
aSortedCollection:= (aOrderedCollection sort: #key ascending) collect:#key.