awesome! I wasn't thinking at all about that, I just remember something
returned lazyseq and I just had to make sure, but was too lazy to think
about it :)
Much appreciated! Thanks!
On Mon, Feb 18, 2013 at 8:36 PM, Marko Topolnik wrote:
> A side note: dorun makes no sense around doseq since do
A side note: dorun makes no sense around doseq since doseq returns nil and
dorun operates on a lazy seq.
On Monday, February 18, 2013 8:16:16 PM UTC+1, AtKaaZ wrote:
>
> => (time (dorun (doseq [x (take 1000 (range))]
> (java.awt.Color. 0 0 *(int a)* 0
> "Elapsed time: 7352.883635 mse
Thank you for the reply.
Does this *(int (or a 0)) *incur any runtime penalty when compared to ^int
(if that would be possible) ? (answer: insignificat)
Well I'll test:
=> *(def a 1)*
#'seesaw.layout/a
=> (time (dorun (doseq [x (take 1000 (range))]
(java.awt.Color. 0 0 *(int a)* 0
"E
Integer is a "boxed" integer in Java. It is a full Java Object. The
java.awt.Color constructor you are calling takes 4 primitive int parameters,
not Integer. Try this:
(set! *warn-on-reflection* true)
(def a 1)
(java.awt.Color. (int 0) (int 0) (int (or a 0)) (int 0))
I'm not so sure what yo
For *or*
=> *(set! *warn-on-reflection* true)
(def ^Integer a 1)
(java.awt.Color. 0 0 ^Integer (or ^Integer a 0) 0)
*clojure-version**
true
#'cgws.notcore/a
Reflection warning, NO_SOURCE_PATH:3:1 - call to java.awt.Color ctor can't
be resolved.
#
{:major 1, :minor 5, :incremental 0, :quali