Last active
January 2, 2016 03:19
-
-
Save johnwalker/8243534 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns nested-vector-ops) | |
(def nested-vector [[:salt 0 5 :deviation 5 10] | |
[:milk 5 4 :deviation 1 2] | |
[:cream 0 0 :deviation 0 0]]) | |
(->> | |
nested-vector | |
(remove (fn [[_ _ _ _ a]] (= "N/A" a))) | |
(sort-by (fn [[_ _ _ _ a]] a)) | |
(reverse)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh. Well, just change zero? to a predicate that tests for N/A, e.g. (= "N/A", and then move the argument in the sort-by function to the fifth position.