Fork me on GitHub
#clojure-dev
<
2018-09-27
>
slipset10:09:39

So, given this piece of code:

slipset10:09:12

(def uhm...rethorical?:P (comp #{:text} :type))

(defn foo [bla]
  (uhm...rethorical?:P bla))

slipset10:09:37

The compiler complains:

slipset10:09:53

CompilerException java.lang.ClassNotFoundException: uhm///rethorical?:P, compiling:(...)

slipset10:09:38

This works if I prefix uhm...rethorical?:P with the ns it’s in, like

slipset10:09:57

my.ns/uhm...rethorical?:P

slipset11:09:06

I guess the short answer is don’t do this 🙂

bronsa11:09:20

yeah, don't :)

bronsa11:09:27

non-namespaced symbols containing . will be resolved as classnames

bronsa11:09:34

with the notable exceptions for macros

bronsa11:09:46

which is why .. works

slipset11:09:35

funny thing is that this works:

slipset11:09:41

(defn foo [bla]
  ((fn uhm...rethorical?:P [b ] ((comp #{:text} :type) b)) "lol"))

bronsa11:09:48

yeah why wouldn't it

bronsa11:09:03

you're not using that symbol to resolve the function

slipset11:09:19

Which is where it came from, but then I needed the fn in two places, so I extracted it, and it didn’t compile.