This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-03
Channels
- # announcements (4)
- # aws (19)
- # babashka (55)
- # beginners (40)
- # biff (4)
- # calva (9)
- # cherry (3)
- # cider (8)
- # clj-kondo (26)
- # clj-yaml (3)
- # clojure (92)
- # clojure-austin (14)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-portugal (3)
- # clojure-uk (2)
- # clojurescript (48)
- # conjure (19)
- # datalevin (14)
- # docker (13)
- # emacs (3)
- # fulcro (21)
- # gratitude (14)
- # improve-getting-started (1)
- # introduce-yourself (2)
- # joker (4)
- # juxt (2)
- # lsp (12)
- # malli (5)
- # meander (17)
- # off-topic (13)
- # re-frame (7)
- # scittle (2)
- # test-check (2)
Ever want to add a dependency, but hesitated or delayed doing so, because it would require having to restart your REPL?
I just tried lambdaisland/classpath
, which scans your deps.edn, and magically updates your classpath: it’s incredible that I could add data.json
and darkstar
to deps.edn, and actually use them just by reloading a namespace. Surreal!
Thank you @plexus and all!
Or, you know, you could just use https://github.com/clojure/tools.deps.alpha/tree/add-lib3 which is what I've been using for ages 🙂
See https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L102 for more detail. I have a hotkey in Calva to load deps from deps.edn
into a running REPL. No restarts needed.
> Ever want to add a dependency, but hesitated This is probably a good thing: adding dependencies should be done with hesitation 😁
> is there anything similar for leiningen? I don't think we have something hot-reload style as in OP. But https://github.com/clj-commons/pomegranate looks pretty similar to the add-libs approach that @U04V70XH6. You could configure your editor to let you have your cursor in a dependency coordinate and then evaluate the necessary pomegrenate form to install it in your REPL. (I think, I haven't actually tried pomegrenate.)
Grateful for the “thread-first” macro ->
; I must confess that I was writing Clojure for about over a month before I found it.
It was like a new pair of glasses when it came to reading my code…

I love the thread first ->
and thread last ->>
macros - I've found they make for code that is quite amenable to change, when you come back to tweak/add/remove part of the pipeline.
It's good to know that your editor probably has a command for evaluating the thread up to the cursor. So if we represent the cursor with |
and issue this command:
(-> 40| => 40
+| => 41
+| => 42
(str "!!!"))
In Calva this is by default bound to ctrl+alt+enter
.
excellent tip @U0ETXRFEW! had no idea this was a thing - in cider/emacs it's cider-eval-sexp-up-to-point
(which happens to be C-c C-v C-o
in my doom emacs setup)

