This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-10
Channels
- # asami (41)
- # babashka (24)
- # beginners (48)
- # calva (41)
- # cider (10)
- # clj-commons (20)
- # clj-kondo (2)
- # cljdoc (8)
- # clojure (131)
- # clojure-australia (4)
- # clojure-europe (17)
- # clojure-hungary (2)
- # clojure-india (2)
- # clojure-nl (3)
- # clojure-uk (1)
- # clojurescript (12)
- # community-development (6)
- # core-logic (4)
- # cursive (11)
- # datomic (22)
- # emacs (25)
- # events (1)
- # exercism (2)
- # fulcro (30)
- # helix (5)
- # honeysql (6)
- # hugsql (3)
- # integrant (12)
- # introduce-yourself (4)
- # lsp (5)
- # malli (5)
- # nextjournal (31)
- # off-topic (4)
- # pedestal (3)
- # portal (51)
- # reitit (33)
- # remote-jobs (1)
- # shadow-cljs (12)
- # sql (10)
- # vim (7)
- # xtdb (37)
Occasionally I have some annoying issue using Cursive which I just haven't been figured out what I am doing wrong.
I have a Clojure REPL running in a terminal. I connect to this backend RELP using Cursive Run configuration: nREPL. Everything is working just fine.
Occasionally I want to experiment with some function X in namespace Y. I change REPL to this namespace (using Switch REPL NS to Current File
) and *ns*
shows that I'm in namespace Y).
Now I load everything in the editor (in namespace Y) into REPL (`Load File in REPL`).
I have a comment
block. In comment block I have some test data. Now I evaluate the test data. Then I call some function X in that namespace with that test data. Everything works fine.
I experiment more. Suddenly the same function X call with the same data gives me error, e.g.:
Execution error (IllegalArgumentException) at y/x .
Don't know how to create ISeq from: clojure.lang.Var$Unbound
If I evaluate the function X, and the test data separately, I can see that there is a binding.
At this point I don't restart the terminal REPL, but I click the Restart REPL
button in the Cursive REPL window. I once again switch REPL to this namespace Y and load everything in the editor into REPL. Everything works once again just fine.
This is a bit annoying. I'm 99% sure this is not a Cursive bug but I have something wrong in my work flow.
I'd appreciate any help how to investigate what is happening in my workflow and how to fix this issue.The rubber duck effect works. I just now realized after writing this that I might have unconsciously hit my Integrant-reset hot key in my laptop. This probably causes this. I need to investigate this a bit. But if you have some hints I'm happy to hear about them! 🙂
I just managed to get this error after hitting my Integrant reset button. But the weird thing is that
(keys (ns-publics *ns*))
Shows the same bindings before and after the Integrant reset, but after the reset I get this clojure.lang.Var$Unbound
error.
I have done a few years Clojure development but I'm not a Clojure guru. I asked about this in the Metosin slack and someone said that he remembers to experience something similar which was a bit weird.No. And the weirdist thing is that this does not happen immediately after hitting Integrant reset - possibly it has nothing to do with it.
Unpleasent to debug this since it behaves as if there is some non-deterministic behaviour, even though my brain says that it cannot be non-deterministic.
what came to mind is if doing a clojure.tools.namespace.repl/refresh, the ns gets removed and recreated. wondered if somehow you had a stale reference to deleted var
Possibly something like that.
i also tried to mix the usage of ctnr/refresh
with the cursive load file / sync files in repl and ended up with inexplicable situations.
but when i work with defprotocol
s or deftype
s, it would be really nice to be able to unload the NSes with those definitions and reload every other NS, which used the previous definitions of those protocols and types.
alternatively, it would be good to have some guides about how to structure a program, which relies on these abstractions, in way, that makes it easy to develop them.
im still not sure i comprehend everything in https://functionalbytes.nl/clojure/lifted/protocols/2020/06/11/lifted.html for example, but i have the feeling, it might help with my issues... :/
One of spec's value propositions is that fdef
adds information to the docs generated for a function, but Cursive's documentation popups don't seem to incorporate this information. Are there plans to add this?