I have a sequence s and a list of indexes into this sequence indexes. How do I retain only the items given via the indexes?
s
indexes
Simple example:
I had a similar use case and came up with another easy solution. This one expects vectors.
I've changed the function name to match other similar clojure functions.
(defn select-indices [coll indices] (reverse (vals (select-keys coll indices))))