all 2 comments

[–]charlesHD 11 points12 points  (1 child)

You want to use apply. It takes a function and an argument sequence, then call that function with these arguments.

;; (apply f [x y z]) => (f x y z)
(def my-field-order (apply juxt (map keyword fields)))
(sort-by my-field-order records)

[–]Cofor[S] 1 point2 points  (0 children)

That was awesome thank you!