This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-08
Channels
- # announcements (4)
- # aws (3)
- # babashka (5)
- # beginners (16)
- # cider (8)
- # clj-kondo (3)
- # clojars (8)
- # clojure (115)
- # clojure-uk (15)
- # clojurescript (18)
- # data-science (5)
- # datomic (14)
- # fulcro (49)
- # funcool (6)
- # graalvm (3)
- # graphql (4)
- # lumo (17)
- # malli (5)
- # off-topic (15)
- # reitit (18)
- # ring-swagger (8)
- # rum (2)
- # shadow-cljs (35)
- # tools-deps (18)
- # uncomplicate (2)
- # vrac (1)
Morning
måning
TIL that *ns*
is only set under certain circumstances (like running code in a repl) .. so code that is evaluated in the repl may not run in gen-class'd (or from nrepl.cmdline) unless you explicitly bind it in your thread (for example in-ns
). very confusing
@cfeckardt My tip: add
(def my-ns *ns*)
at the top of a namespace where you need to reference the namespace reliably and then you can use my-ns
. That avoids the ways that *ns*
is rebound differently between compilation and runtimethanks.
I needed to call tools.namespace.repl/refresh
, but was unable to under some circumstances. I just wrapped my call in (binding [*ns* 'clojure.core] (.../refresh ...))
and it works
Life is often a lot simpler if you adopt an RDD workflow that doesn't depend on refresh/reload 🙂
Eric Normand talks about that in his RDD course (well worth a month's subscription to http://PurelyFunctional.tv just for that course alone) and Stu Halloway has touched on this in a couple of his talks and podcast appearances.
I never use any sort of refresh/reload workflow. I've seen too many people run into problems with it -- and back when I did try it, I also saw "inexplicable" failures -- so I've just developed a workflow (like Eric and Stu, it seems) where I just don't need it.