top | item 20387159

(no title)

cljs-js-eval | 6 years ago

Clojure has "reader conditionals" which enable you to write a single file and only have divergent code paths when you need to do something that is JVM or JS specific (or CLR-specific, if you're into that).

It's super helpful for shared libraries. A lot of our code can be shared between JVM servers, JS lambdas, or JS frontend code without much development effort. It's mostly just a matter of naming a file .cljc and you're off to the races.

discuss

order

pjmlp|6 years ago

Kotlin and Scala have it as well.