Andy Fingerhut
added a comment - 24/Sep/12 11:20 AM If someone wants to improve the behavior of int in this case, they should also consider similar improvements to the error messages for unchecked-int, char, and unchecked-char.

int knows how to coerce numbers and chars to ints. It does not currently support Strings. It would be worthwhile to either add this behavior or make int's docstring more descriptive than just "Coerce to int".

Alex Miller
added a comment - 03/Sep/13 12:04 PMint knows how to coerce numbers and chars to ints. It does not currently support Strings. It would be worthwhile to either add this behavior or make int's docstring more descriptive than just "Coerce to int".

Notably, (map int ["1" "2" "3"]) fails with "ClassCastException java.lang.String cannot be cast to java.lang.Character" using this patch.
It emanates from RT.java from intCast(Object). So it looks like the Strings are losing their types when they're being mapped over.
I would guess this is intentional?

Michael Drogalis
added a comment - 05/Sep/13 12:39 PM Notably, (map int ["1" "2" "3"]) fails with "ClassCastException java.lang.String cannot be cast to java.lang.Character" using this patch.
It emanates from RT.java from intCast(Object). So it looks like the Strings are losing their types when they're being mapped over.
I would guess this is intentional?