planck

Planck ClojureScript REPL
slipset 2016-04-13T08:24:41.000076Z

while working on this, I see this:

slipset 2016-04-13T08:24:49.000077Z

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

slipset 2016-04-13T08:25:18.000078Z

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

slipset 2016-04-13T13:23:47.000079Z

which, I guess is, because of this:

mfikes 2016-04-13T13:29:10.000082Z

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.

slipset 2016-04-13T14:08:42.000083Z

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

slipset 2016-04-13T14:08:57.000084Z

since a char in java is a number

mfikes 2016-04-13T14:14:58.000085Z

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

mfikes 2016-04-13T14:16:24.000086Z

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