The following works in Clojure:
(keys (filter (comp odd? val) {:a 1 :b 2 :c 3}))
The docstrings for keys
and vals
don't indicate that you can do this. Is this accidential or intentional?
I vaguely recall Alex Miller indicating at some point that this capability was deemed useful and is intentionally allowed. Yes, this is an appeal to authority, but nevertheless, it makes a fairly convincing argument.