This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-28
Channels
- # announcements (2)
- # babashka (21)
- # beginners (24)
- # calva (9)
- # cider (7)
- # clj-kondo (12)
- # clojure (116)
- # clojure-europe (5)
- # clojure-korea (2)
- # clojure-norway (3)
- # clojure-poland (1)
- # clojure-spec (5)
- # clojurescript (12)
- # cursive (12)
- # datomic (8)
- # google-cloud (4)
- # honeysql (16)
- # java (18)
- # lsp (10)
- # missionary (14)
- # polylith (12)
- # re-frame (13)
- # releases (4)
- # shadow-cljs (10)
- # sql (10)
- # testify (2)
Hello @genekim Sorry for being quiet. I guess previous week was a bit too stressful for me. Now I'm currently unable to reproduce the problem with not seeing test-comment. I think I was tripped by myself, fiddling a bit too much in the repl, when I lost reference to test-comment. I also thought that the eval-as-use was broken, but I was probably just too occupied with other things.. And wrote something as following, without thinking clearly:
(ns my.namespace
(:require [testify :refer [test-comment eval-as-use]]))
(def a 23)
(test-comment
(def a 12)
(println a))
(comment
(eval-as-use 'my.namespace))
..and got devastated when I saw the error message:
Syntax error (IllegalStateException) compiling def at (src/my/namespace.clj:8:3).
a already refers to: #'my.namespace/a in namespace: my.namespace-16699
But that is how it should be. The content of the test-comment is evaluated in a new namespace, here my.namespace-16699, which is referring to my.namespace with use. You see that process on out. If you refer everything in a namespace, here 'a, and try to add something equally named, here (def a 12), you should get an error, and you do get that same error doing the same thing in a repl manually.
So nothing wrong there. Now, I guess it's time to see if I can try to reproduce your experience, in an environment similar to yours. Eager to find new issues...
Thanks again@genekim. Now I have tried Cursive for the first time in many years. I don't really remember the last time, so I can't say whether its an improvement. But I sure it is, as it was pretty easy. I wrote the following in a clojure project:
(ns testingsomerepl.core
(:require [testify :refer [test-comment eval-in-ns]]))
(test-comment
(println "Hello"))
(comment
(eval-in-ns 'testingsomerepl.core))
I managed to start a repl, found a way to eval content of the comment, and it did write the following in the repl window:
(eval-in-ns 'testingsomerepl.core)
(clojure.core/in-ns 'testingsomerepl.core)
=> #object[clojure.lang.Namespace 0x681035ac "testingsomerepl.core"]
(println "Hello")
Hello
=> nil
=> nil
.. success and perhaps a moment to consider moving away from emacs 🙂
Does the similar thing work for you?