This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-16
Channels
- # aws (17)
- # babashka (2)
- # beginners (131)
- # bristol-clojurians (1)
- # calva (16)
- # chlorine-clover (6)
- # cider (10)
- # clara (5)
- # cljsrn (82)
- # clojure (176)
- # clojure-dev (14)
- # clojure-europe (13)
- # clojure-italy (13)
- # clojure-nl (4)
- # clojure-spec (10)
- # clojure-sweden (32)
- # clojure-uk (32)
- # clojuredesign-podcast (2)
- # clojurescript (34)
- # community-development (2)
- # conjure (17)
- # cursive (4)
- # datomic (51)
- # emacs (6)
- # figwheel-main (26)
- # fulcro (16)
- # graalvm (11)
- # jobs (2)
- # jobs-discuss (30)
- # kaocha (4)
- # meander (23)
- # off-topic (34)
- # pathom (5)
- # re-frame (10)
- # reagent (3)
- # reitit (6)
- # releases (3)
- # sci (36)
- # shadow-cljs (27)
- # sql (9)
- # testing (6)
- # tools-deps (28)
- # vim (8)
Just finished juxt. It's one of my favorites. Perhaps my favorite use is computing the coordinates on a unit circle given an input in radians:
(def unit-coordinates (juxt #(Math/cos %) #(Math/sin %)))
I hadn't thought of using juxt for map-vals before:
(defn map-vals [f m]
(->> m
(map (juxt key (comp f val)))
(into (empty m))))
(map-vals inc {:a 1 :b 2})
=> {:a 2, :b 3}
I've always used zipmap but that breaks up your thread-last form. This allows you to keep the thread rolling. Cool!
I see myself using the latter more. The former is cool, but I don't finding myself doing geometry as much as I'd like.