Re: clojure type casting vs java type casting

2011-09-21 Thread Nathan Sorenson
long entails a call to RT/longCast, which dynamically dispatches on the type of the object passed to it. I haven't tested this, but i would imagine the java cast would compile directly to the single byte- code instruction i2l. Presumably, then, the java call would be a touch faster by a few instruc

clojure type casting vs java type casting

2011-09-17 Thread Brent Millare
Is the following clojure code: (long (.some-method-that-returns-int this)) equivalent in semantics and performance to the following java code: (long)some-method-that-returns-int(); I need to make type casts in an inner loop (hot zone), and I was wondering if there was something implicit that ma