Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created June 16, 2010 12:25
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 swannodette/440593 to your computer and use it in GitHub Desktop.
Save swannodette/440593 to your computer and use it in GitHub Desktop.
(defn test-array [n]
(let [a (longs (make-array Long/TYPE n))]
(amap a i result
(aset result i (rand-int 2)))))
(test-array 100) ; No matching method found: aset [Thrown class java.lang.IllegalArgumentException]
(defn test-array [n]
(let [a (longs (make-array Long/TYPE n))]
(amap a i result
(aset result i (long (rand-int 2))))))
(test-array 100) ; works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment