When I was first learning Clojure I stumbled on a "lack of good documentation" in third party libraries. I'd google around for something that solved the problem I was trying to solve so I wouldn't reinvent the wheel. I'd find, say, a github repo that had a couple of sentences in its README that purported to solve my problem and then nothing else. What the hell, I thought; why no decent doc? Then I realized: the solution was implemented in 40 lines of Clojure. Reading the source was the fastest way to figure it out.
It still happens to me. Every time it does, I have this warm feeling of investing in something of great value.
Code never lies, comments sometimes do (Charles de Gaulle)
I'm trying to implement it in Kotlin and am curious how it would compare.
(def mymap {"asd" 1 "qwe" 2 "rtz" 3 "foo" 4 "bar" 5 "quz" 6 "bnm" 7})
(let [ints (->> (filter (comp odd? count key) mymap)
(sort-by (comp int last first))
(map (fn [[s i]]
(+ (count s) i))))]
(reduce + 0 (map * ints (reverse ints))))
Gives me 341
Compare the the code size in Java and Clojure.
If that is not enough, do the same thing but start with java objects (and their clojure equivalent: a hashmap) for some given object/map property.
EDIT: And if that is not enough, use as property of the object a string, defined only during run-time by a user input.