This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-26
Channels
- # aleph (1)
- # announcements (9)
- # aws (6)
- # babashka (18)
- # babashka-sci-dev (25)
- # beginners (79)
- # calva (30)
- # cider (34)
- # clj-kondo (25)
- # cljsrn (6)
- # clojure (26)
- # clojure-australia (1)
- # clojure-europe (6)
- # clojure-norway (1)
- # clojure-poland (6)
- # clojure-uk (3)
- # clojured (2)
- # clojurescript (14)
- # datomic (19)
- # events (1)
- # google-cloud (1)
- # gratitude (2)
- # helix (1)
- # hyperfiddle (2)
- # interceptors (1)
- # jobs (17)
- # joyride (96)
- # leiningen (5)
- # lsp (20)
- # minecraft (2)
- # nbb (5)
- # other-languages (1)
- # re-frame (34)
- # releases (2)
- # shadow-cljs (15)
- # spacemacs (1)
- # xtdb (19)
Hi everyone, We use lein checkouts (+ cider and spacemacs) extensively to develop across projects. We keep encountering
a weird problem where for certain records and protocols we have to individually go to their namespaces and evaluate the buffer
in order for them to be loaded. Has anyone had the same problem ? Is it related to lein?
Thanks
----
More specifically these are the three types of errors we get as a result :
1. we get method does not implement the interface
error on records that are already required
2. we get no method
on multispec
s whose corresponding namespaces are indeed required (and more generally on multimethod
s). To fix it we are sometimes forced to stop the repl, do lein clean
and start again.
3. we get compilation failure for the current namespace on the require
line for some problematic namespace. Then wen we switch to that namespace and reevaluate the buffer to fix this issue.
Do you require the namespaces anywhere? Is the problem that they aren't evaluated at all or perhaps that there are stale definitions
Yeah, they are required in the current namespace. Most of the time the problem seems to be that they are not evaluated at all. These are the three types of errors we get as a result :
1. we get method does not implement the interface
error on records that are already required
2. we get no method
on multispec
s whose corresponding namespaces are indeed required (and more generally on multimethod
s). To fix it we are sometimes forced to stop the repl, do lein clean
and start again.
3. we get compilation failure for the current namespace on the require
line for some problematic namespace. Then wen we switch to that namespace and reevaluate the buffer to fix this issue.
Thanks again @U06BE1L6T
Sometimes there's a problem with aot compilation- like if you do lein uberjar in the same project and then start the repl the classes from the target dir might clash with repl trying to load the namespaces. Then of course if you reevaluate the protocol but forget to reeval implementations/records (notably if they are in different namespaces) then you will get a mismatch too (the old records instances no longer implement the new protocol instance)