Hello, after reading words in from a file and reducing to a map:
{aabdgoo (abogado), aaceilmnotx (exclamation), ehpryz (zephyr), eirt (tire rite), ghirt (right)}
and then filtering, I have this:
([aabdgoo (abogado)] [aaceilmnotx (exclamation)] [eirt (tire rite)] [ghirt (right)])
I can run functions like vals
and keys
and further reductions on this with no problem.
I wanted to sort the word list in the second position of each vector and thought it would be trivial to map over this structure but after hours of iteration I can't get it to work.
(map #('((first %) (second %))) input)
throws Execution error (ClassCastException)
on the line of the map: class clojure.lang.PersistentList cannot be cast to class clojure.lang.IFn (clojure.lang.PersistentList and clojure.lang.IFn are in unnamed module of loader 'app')
.
(map #([(first %) (second %)]) input)
makes the tooling complain that Vector can only be called with 1 arg but was called with: 0
.
(map #(vector (first %) (second %)) input)
throws Execution error (ClassCastException)
a couple of lines later when I call keys
on the map
output: class clojure.lang.PersistentVector cannot be cast to class java.util.Map$Entry (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.util.Map$Entry is in module java.base of loader 'bootstrap')
.
I don't know what it wants. What am I doing wrong?
Thank you