Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

With the java.lang.Math operations all being wrapped, then is it also desirable to do the same with the operations static methods on Double and Long?

Some of these functions have simple Clojure(Script) implementations. For instance, Double/isNaN can be achieved with #(identical? ##NaN %) but it seems that if the language works with values like ##NaN, then there should be a built-in way of recognizing it. (I note that some people may not realize that #(= ##NaN %) will not work).

Each of these functions can also be implemented in ClojureScript. This was demonstrated while reimplementing the clojure.math namespace for ClojureScript, since many of these methods from Long and Double were needed.

1 Answer

0 votes
edited by

NaN? and infinite? were added in 1.11.0-alpha3 (along with parse-long, parse-double, and parse-boolean). That's all we're planning to do in 1.11.