I wrote a very simple date library in Clojure, and I would like to be able to use it when my code runs in the JVM and when it is compiled into Javascript with ClojureScript. A fly in a stroke is how to determine the runtime environment in which the code resides so that the macro can use the string syntax analysis mechanism. Each platform date object
How to write a library that can be reused on different deployment platforms such as JVM, JS, CLR, etc.? I know that you can spoof and parse date strings with a regular expression, but it will not easily cover the case of parsing month names from a wide variety of human languages that are well versed in date parsing libraries.
source
share