This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-31
Channels
- # announcements (3)
- # aws-lambda (1)
- # babashka (122)
- # beginners (241)
- # calva (28)
- # cider (7)
- # clara (7)
- # clj-kondo (43)
- # clojars (5)
- # clojure (326)
- # clojure-europe (60)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-spec (21)
- # clojure-uk (4)
- # clojurescript (162)
- # cursive (30)
- # datomic (3)
- # editors (5)
- # emacs (4)
- # figwheel-main (1)
- # fulcro (24)
- # gratitude (3)
- # helix (7)
- # honeysql (20)
- # improve-getting-started (1)
- # introduce-yourself (11)
- # jobs (3)
- # joker (2)
- # kaocha (15)
- # lsp (21)
- # lumo (2)
- # meander (3)
- # off-topic (34)
- # re-frame (6)
- # reagent (1)
- # releases (4)
- # rum (2)
- # shadow-cljs (37)
- # spacemacs (16)
- # tools-deps (16)
- # vim (23)
- # xtdb (32)
I’m running into an issue with indentation and threading macros, as they are specified as having 1 special form, but fairly often we’re threading things into threading macros, usually with cond->
, like
(cond-> x
:always inc
(even? x) (cond->
(< x 10) (* 2)
:else (+ 5)))
so the second cond->
has no special form. the indent on the second cond->
looks kind of unpleasant and cljfmt complains about it (suggesting a 1-space indent which is inconsistent with the first cond->
)
my setup indentation-wise is stock clojure-mode
/`cider` as far as i can tell. an indent specification of (cond-> :defn)
looks a bit better:
(cond-> x
:always inc
(even? x) (cond->
(< x 10) (* 2)
:else (+ 5)))
but cljfmt still complains about this, saying the indentation on the second cond should be 1 space.
so is there an accepted style for things like this? and a way to get clojure-mode and cljfmt to play nicely together?> so is there an accepted style for things like this? avoidance :) https://stuartsierra.com/2018/07/06/threading-with-style