while working on this, I see this:
cljs.user=> (int \a)
WARNING: cljs.core$macros/bit-or, all arguments must be numbers, got [string number] instead. at line 1
0
cljs.user=>
Only tested in planck, but I imagine it is the same for cljs as well.
which, I guess is, because of this:
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L1096
Yep. This question came up in the main ClojureScript channel yesterday. If you try the same in Clojure you’ll see that int
wants numbers. Also, the unit tests all appear to coerce doubles to ints.
the point, in fact is that in Clojure, (int \a)
returns 97
since a char in java is a number
Yeah, maybe that one just happens to slip by, kind-of like (max \a)
not failing.
Interestingly, in Clojure (number? \a)
is false