Skip to content

Instantly share code, notes, and snippets.

@johnwalker
Last active January 2, 2016 03:19
Show Gist options
  • Select an option

  • Save johnwalker/8243534 to your computer and use it in GitHub Desktop.

Select an option

Save johnwalker/8243534 to your computer and use it in GitHub Desktop.

Revisions

  1. johnwalker revised this gist Jan 4, 2014. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions handler.clj
    Original file line number Diff line number Diff line change
    @@ -6,5 +6,6 @@

    (->>
    nested-vector
    (remove (fn [[_ _ _ _ a]] (zero? a)))
    (sort-by (fn [[_ _ a _ _]] a)))
    (remove (fn [[_ _ _ _ a]] (= "N/A" a)))
    (sort-by (fn [[_ _ _ _ a]] a))
    (reverse))
  2. John Walker created this gist Jan 3, 2014.
    10 changes: 10 additions & 0 deletions handler.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    (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]] (zero? a)))
    (sort-by (fn [[_ _ a _ _]] a)))