Skip to content

Instantly share code, notes, and snippets.

@kindlychung
Created May 7, 2015 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kindlychung/455d586af55bb7262407 to your computer and use it in GitHub Desktop.
Save kindlychung/455d586af55bb7262407 to your computer and use it in GitHub Desktop.
(defn array-sum [^ints xs]
(loop [index 0 acc 0]
(if (< index (alength xs))
(recur (unchecked-inc index) (+ acc (aget xs index)))
acc)))
(time (array-sum (into-array (range 400))))
@kindlychung
Copy link
Author

CompilerException java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to [I, compiling:(/Users/kaiyin/personal_config_bin_files/workspace/cina/src/cina/ref_types.clj:1:24)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment