by wging · 13y ago · 0 comments
Edit: Actually, we can also get rid of the 'reverse' by replacing (sort-by val) with (sort-by (comp - val)). Not going to be shorter in terms of character count, though we win on line count.
(->> (string/split s #"\s+")
frequencies
(sort-by val >)
(take 10))
Just mentioning it here because I find it vastly more readable than (comp - val).