Perché (int 10)
non produce un'istanza di tipo java.lang.Integer
?Perché (int 10) produce un'istanza lunga?
; why Long here?
=> (type (int 10))
; java.lang.Long
; this one is also Long, why not java.lang.Number?
=> (type (num 10))
; java.lang.Long
=> (type (double 10))
; java.lang.Double
=> (type (long 10))
; java.lang.Long
=> (type (float 10))
; java.lang.Float
=> (type (short 10))
; java.lang.Short
=> (type (bigint 10))
; clojure.lang.BigInt
=> (type (bigdec 10))
; java.math.BigDecimal
=> (type (boolean 10))
; java.lang.Boolean
=> (type (char 10))
; java.lang.Character
=> (type (byte 10))
; java.lang.Byte
È stato corretto in Clojure 1.5: http://dev.clojure.org/jira/browse/CLJ-820 L'ho testato in Clojure 1.6 e (tipo (int 10)) fornisce java.lang.Integer. –