This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-29
Channels
- # announcements (1)
- # beginners (40)
- # calva (30)
- # cider (3)
- # clj-kondo (1)
- # cljdoc (12)
- # clojure (79)
- # clojure-dev (7)
- # clojure-france (4)
- # clojure-spec (10)
- # clojure-uk (13)
- # clojurescript (19)
- # core-async (1)
- # core-typed (1)
- # cursive (2)
- # datomic (2)
- # emacs (3)
- # events (1)
- # kaocha (2)
- # klipse (14)
- # off-topic (26)
- # pathom (1)
- # reagent (8)
- # rewrite-clj (8)
- # shadow-cljs (22)
- # tools-deps (18)
Hm, I'm having trouble with multimethods in ClojureScript.
(def h (derive (make-hierarchy) :a :b))
(defmulti testmulti identity
:hierarchy #'h)
(defmethod testmulti :b [x]
(println "defmethod" x))
When I eval the defmethod
after defmulti
, I get "#object[Error Error: No protocol method IDeref.-deref defined for type cljs.core/PersistentArrayMap: {:parents {:a #{:b}}, :ancestors {:a #{:b}}, :descendants {:b #{:a}}}]"Oh, maybe it's because I wrote it wrong at first, and it's not cleared out by just evaling again.
Is there a way to reload a clojurescript namespace, throwing away all the old definitions?
Is it possible to require/import/make available an .edn file to a CLJS file at compile time?
hmm, any other pointers? i'm a beginner
ah okay, i'll swing at that. thanks!
Assuming you have a file containing some edn, then this would make that value available in your code at compile time.
this is possible because macro expansion happens at compile time, and performs the side effect locally?
It is better to avoid these sort of macros if you can, but, it is certainly possible to write them.
Hi fine people. Does anyone know how to add nrepl middleware when using deps.edn? I'm trying to get a shadow-cljs clojurescript repl working in Cursive's local nrepl https://github.com/thheller/shadow-cljs/issues/517