Lots of java classes are advertized in clojure as symbols containing the dot character. e.g.,
If I type either java.lang.constant.Constable
or java.lang.constant.ConstantDesc
at the repl, it evaluates to an object whose printed representation is identical to its symbol spelling, but whose type is class
, i.e., class?
returns true.
I have a couple of questions about these.
- is the . character in the symbol special syntax, or is it just an ordinary character in the spelling of the symbol, like a, b, and c?
- who sets the values of these? Is it done by automatically by clojure at startup, or is it a side effect of requiring something in a namespace?
Why do I ask? It is because I’m using something similar to (resolve 'java.lang.constant.Constable)
in some of my test cases. When I run the test cases interactively within cider, and also from the shell command line via “lein test”, all the tests pass. However, when the tests are run in my gitLab CI pipeline, via “lein test” in a docker image (resolve 'java.lang.constant.Constable)
evaluates to false
. or at least the assertion (assert (resolve 'java.lang.constant.Constable))
fails.
What might be causes the CI pipeline to fail? Might it be a function of the java version? or a function of the clojure version? Can I require something in my namespace to assure that these symbols are resolvable?