I don't know that I agree with that reason. Clojure numerics start from an 
assumption of a 64-bit world, so numbers default to 64-bit types: long and 
double, instead of 32-bit int and float. Java interop is one of the places 
where this default can create a mismatch, since Java tends to use 32-bit 
integers in the bulk of its APIs (strings, arrays, and collections in 
particular). In most cases, the conversion will happen automatically for 
you, but it sometimes matters in performance-intensive code and there are 
some tricks for working around this in those cases.

And in general it really is Long (not long) - by default all Clojure values 
are objects, unless you have taken steps to use primitives.


On Tuesday, August 5, 2014 10:47:57 AM UTC-5, Michael Klishin wrote:
>
> On 5 August 2014 at 19:43:21, Cecil Westerhof ([email protected] 
> <javascript:>) wrote: 
> > > Because of the class of those values is Long. Why are those not   
> > Integer? 
>
> To avoid the performance penalty of automatic promotion. In dynamically 
> typed languages 
> with auto-promotion of integers you have to perform a promotion check for 
> every 
> operation. 
>
> It's not Long, by the way, it is long (the primitive).  
> --   
> @michaelklishin, github.com/michaelklishin 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to