Fork me on GitHub

how can I improve below code

(if (seq? v)
      (or v "null"))


Does the string "null" have to be returned?


Or is nil acceptable?


(if (or (seq? v) v) "null" v)


(or (seq v) "null")


yes if it is not a seqence and v is nil it should return null


@U11EL3P9U’s solution will work well but it will change the concretion of v. So if you don't care about that, then it might be the best solution


not change per se, but it will give you a seq.


Just hit this nice error but only when running from a generated jar,

** ERROR: **
Exception: #error {
 :cause No binding factory for namespace  registered.
   :message org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for null
   :at [org.apache.cxf.jaxws.ServiceImpl getPort 344]}
  {:type org.apache.cxf.service.factory.ServiceConstructionException
   :message Could not resolve a binding for null
   :at [org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory createBindingInfo 361]}
  {:type org.apache.cxf.BusException
   :message No binding factory for namespace  registered.
   :at [org.apache.cxf.bus.managers.BindingFactoryManagerImpl getBindingFactory 93]}]
Its seems like a bit of a strange error using the bing api via interop and its heavily xml based but I don't even know where to start looking when it runs from clj but not java -cp cli.jar

Alex Miller (Clojure team)12:06:37

In Java, you can define service impls in a jar manifest, possibly that's getting stripped when you make an uberjar. How do you make the jar?


So I have this in my deps.edn and run clj -Xuberjar

:uberjar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.278"}}
                     :exec-fn hf.depstar/uberjar
                     :exec-args {:verbose true :aot true :main-class :jar "target/car-cli.jar"}}
I will do a bit of googling around what impls are as well see if that helps 🙂


I am building a twitter clone just to get myself acquainted with everything Clojure. Any database recommendations?

🙌 2

stick with the one you know the most 🙂

👆 6

Yup, try to be learning one thing at a time!


Clojure offers several decent solutions for Postgres, FWIW.


Thank you for replying. I'll continue with mongo unless there is a great reason not to for the moment

Jim Strieter00:06:31

FWIW, I got postgresql working with < 8 hrs of "no suitable drivers found" type errors, and I'm new to SQL, postgres, Java, Clojure, etc.