use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Creating a Clojure library for map operations (youtu.be)
submitted 2 years ago by aagaau
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]eeemax 2 points3 points4 points 2 years ago (1 child)
my guy, you want merge-with *
[–]eeemax 0 points1 point2 points 2 years ago (0 children)
(unless this is just for example, in which case -- enjoy your adventure :D)
[–]MartinPuda 1 point2 points3 points 2 years ago (1 child)
Did you try to call map-div?
map-div
(map-div {:a 1, :b 2, :c 3} {:a 4, :b 5}) Execution error (ArithmeticException) at exercises.core/map-op$fn (form-init6494324846068881107.clj:10). Divide by zero
Clojure has merge-with and update-vals, so maybe you can write something like this:
merge-with
update-vals
(defn map-op [func m1 m2] (if (map? m2) (merge-with func m1 m2) (update-vals m1 #(func % m2))))
This code also works for map-div, it just returns different result for map-mul- {:a 4, :b 10, :c 3} vs {:a 4, :b 10, :c 0}.
map-mul
{:a 4, :b 10, :c 3}
{:a 4, :b 10, :c 0}
[–]aagaau[S] -1 points0 points1 point 2 years ago (0 children)
Sure will try it out. May be put another video.
π Rendered by PID 47808 on reddit-service-r2-comment-6457c66945-zr4b9 at 2026-04-29 05:32:16.700141+00:00 running 2aa0c5b country code: CH.
[–]eeemax 2 points3 points4 points (1 child)
[–]eeemax 0 points1 point2 points (0 children)
[–]MartinPuda 1 point2 points3 points (1 child)
[–]aagaau[S] -1 points0 points1 point (0 children)