beginners 2026-04-02

What's the right way to create a library (at all) and then what is the right way to create a library that is compatible for import with both Clojure JVM and Babashka?

If you want to ensure it's compatible with babashka, I'd recommend running its tests with babashka

🧠 2

You can use reader conditionals #?(:bb 1 :clj 2) or use a macro like:

(def bb? (System/getProperty "babashka.version"))
(defmacro if-bb [then else] (if bb? then else))

🙌 1

Creating a Clojure library is as simple as putting a Git(hub) repo up and adding a deps.edn

👀 1

Fattest thank you possible @borkdude, all questions sated!

Alex Miller (Clojure team) 2026-04-02T19:41:34.202059Z

should probably also mention that this should be done in a .cljc file extension.

(it doesn't tackle the cross-dialect aspect, but it seems you got that answered above)