Fork me on GitHub
#chlorine-clover
<
2020-09-21
>
seancorfield04:09:49

Ran into a strange thing today: I have a namespace that defines a function format; it has (:refer-clojure :exclude [format]), it works when run from a regular REPL, it works when run in tests (the ns required :as sut and then sut/format). But via Chlorine, it seems to think format is clojure.core/format. I can't run (format ...) in my ns because Chlorine seems to run (clojure.core/format ...) and even when I try to run the tests, it seems to think sut/format doesn't exist...

sogaiu05:09:12

that is strange

seancorfield05:09:47

Yeah, I'm real puzzled. Not sure what's going on there.

seancorfield05:09:16

I've tried it on two Chlorine setups: macOS and Windows+WSL. Same weird behavior.

sogaiu05:09:20

@seancorfield i get the same issue on linux fwiw

sogaiu05:09:13

i tried explicitly evaluating in-ns as well before evaluating a custom format defined in an ns with (:refer-clojure :exclude [format])

sogaiu05:09:27

even using a fully qualified symbol (e.g. my-ns/format) yields the same results

sogaiu05:09:38

i suspect unrepl is up to something 🙂

seancorfield05:09:59

Yeah, it's weird because in another ns it seems to be okay to define format 😐

mauricio.szabo12:09:35

Wow, strange indeed. I'll look at it right now

mauricio.szabo14:09:10

Seems like a bug. Probably on my part, really...

mauricio.szabo14:09:34

Right, found out. To avoid more bizarre errors, I was using ns instead of in-ns before running any code on specific namespace. But it seems that its behavior is quite bizarre when a namespace already exist 😞

seancorfield16:09:22

Cool. I just went to check how it would behave in the namespace-not-existing case and see you've preserved that behavior. Thanks for the quick fix!

mauricio.szabo16:09:17

Yes, when the namespace does not exist Clojure sometimes give such a strange error that's hard to explain what's happening...

seancorfield20:09:45

Thanks for the quick fix on that @mauricio.szabo -- I can confirm that my format issue has gone away now 🙂

👍 6
sogaiu22:09:55

worked here too :)

sogaiu22:09:50

i apologize to the unrepl gods