Fork me on GitHub
#planck
<
2016-04-13
>
slipset08:04:41

while working on this, I see this:

slipset08:04:49

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=> 

slipset08:04:18

Only tested in planck, but I imagine it is the same for cljs as well.

slipset13:04:47

which, I guess is, because of this:

mfikes13:04:10

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.

slipset14:04:42

the point, in fact is that in Clojure, (int \a) returns 97

slipset14:04:57

since a char in java is a number

mfikes14:04:58

Yeah, maybe that one just happens to slip by, kind-of like (max \a) not failing.

mfikes14:04:24

Interestingly, in Clojure (number? \a) is false