I've written a very simple date library in Clojure and I'd like to be able to use it both when my code runs in a JVM and when it is compiled to Javascript with ClojureScript. The fly in the ointment is how to detect which runtime environment the code is in so that a macro might use the platform's own date string parsing mechanism. Each platform's date objects
How should one write a library that may be reused across different deployment platforms like the JVM, JS, CLR etc.? I know that one might cheat and parse date strings with a regex but that will not easily cover the case of parsing month names from the large variety of human languages which the built-in date parsing libraries solve quite nicely.