Last active
March 21, 2016 14:08
-
-
Save apmaricich/5cb65d9e667b7698b138 to your computer and use it in GitHub Desktop.
clj: converts a java arraylist to a map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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