• Skip to primary navigation
  • Skip to content
  • Skip to footer
Clojure Diary Clojure Diary
  • Search
  • Book
  • Code
  • Videos
  • Donate

    map operation functions in Clojure

    less than 1 minute read

    Code

    ;; map_ops_2.clj
    
    (merge-with + {:a 1 :b 2} {:b 3})
    
    (update-vals {:a 1 :b 2} inc)
    
    (defn greatest [x y] (if (< x y) y x))
    
    (greatest 1 2)
    
    (greatest 2 1)
    
    (merge-with greatest {:a 1 :b 2} {:b 3})
    
    (merge-with greatest {:a 1 :b 2} {:b 3})

    Notes

    • map operations - like adding, multiplying two maps and so on

    Updated: January 6, 2026

    Twitter Facebook LinkedIn
    Previous Next

    You May Also Enjoy

    Simple decorator in Clojure

    less than 1 minute read

    rswan 1.1.0, and other Clojure updates

    less than 1 minute read

    map operations

    1 minute read

    Understanding Probabilistic Computing with Clojure

    less than 1 minute read

    • Feed
    © 2026 Clojure Diary. Powered by Jekyll & Minimal Mistakes.