I am currently using sortedCollection that stores dictionary of character (key) and number of occurrence for that character (value). When iterating through sortedCollection, how do I access the key value only?
e.g.
[que last notNil] whileTrue: [
stdout << 'current character is ' *key* << ' and occurs << *val* << ' times.' << nl.
]
Where que
is the sortedCollection that sorts dictionary by value.
My goal is following: let's say que
has:
[$a:20, $e:100]
where first letter is the key of dictionary and second number is the value of dictionary. My output should look something like this:
current character is a and occurs 20 times.
current character is e and occurs 100 times.
I am not sure how to get a
, or the key in dictionary since keys are arbitrary.