Skip to content

Instantly share code, notes, and snippets.

@apmaricich
Last active March 21, 2016 14:08
Show Gist options
  • Select an option

  • Save apmaricich/5cb65d9e667b7698b138 to your computer and use it in GitHub Desktop.

Select an option

Save apmaricich/5cb65d9e667b7698b138 to your computer and use it in GitHub Desktop.
clj: converts a java arraylist to a map
(defn arraylist->map¬
"Converts an arraylist java object to a list"
[al]
(loop [finished-list {}
counter 0]
(if (>= counter (.size al))
finished-list
(recur (into finished-list (.get al counter))
(inc counter)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment