This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-01
Channels
- # announcements (14)
- # aws (1)
- # babashka (22)
- # beginners (105)
- # biff (12)
- # calva (1)
- # cider (7)
- # cljsrn (1)
- # clojure (33)
- # clojure-europe (22)
- # clojure-germany (1)
- # clojure-uk (3)
- # clojurescript (28)
- # component (15)
- # copenhagen-clojurians (1)
- # core-typed (29)
- # cursive (8)
- # data-science (2)
- # datomic (2)
- # emacs (16)
- # gratitude (3)
- # humbleui (3)
- # introduce-yourself (4)
- # lsp (1)
- # other-languages (3)
- # rdf (3)
- # sci (6)
- # shadow-cljs (9)
- # spacemacs (12)
- # tools-build (1)
- # tools-deps (5)
- # vim (3)
- # vscode (1)
I tried using the simple thing, i.e something like this
(comment
(def system (dev-system (cljcrd.conf/conf (cljcrd.conf/env))))
(alter-var-root #'system component/start)
(alter-var-root #'system component/stop)
)
and it works fine ! starting and stopping are idempotent and work fine! ty again@seancorfield I saw you don't recommend using the tools.namespace
; how do you "reload" a webapp when something changes ? use ring.middleware.reload ?
If you haven't already, see Sean's presentation at London Clojurians https://www.youtube.com/watch?v=gIoadGfm5T8
If a function definition has changed (in a file), just re-eval that function in the REPL. If you do that every time you make any changes, the REPL state will be in sync with the file state.
Similarly, if some data file has changed, re-run any functions that maintain any state that depends on the changed data.
See https://clojure.org/guides/repl/enhancing_your_repl_workflow#writing-repl-friendly-programs as well.
thank you both for explaining
I don't "reload a webapp" -- I just eval the changed code into the REPL.
so you change the code in your editor and re-eval immediately
yes that's a great way of workin
Every time I change a function I hit a hot key that does "eval top block" so the new definition is in the REPL, and I use #'func
references instead of func
so that passing functions as HOF will pick up the new version automatically (per that http://clojure.org page).
No "reload", no "refresh", no file watchers. Always eval everything into the REPL from your editor as you work. That's how my REPLs stay up and running for weeks.
could you explain the #'func
bit? where should i use that instead of func
? whenever a function is passed ?
Read the link I posted.