SHOW:
|
|
- or go back to the newest paste.
1 | (mapify (parse (slurp filename))) | |
2 | ({:name "Edward Cullen", :glitter-index 10} {:name "Bella Swan", :glitter-index 0} {:name "Charlie Swan", :glitter-index 0} {:name "Jacob Black", :glitter-index 3} {:name "Carlisle Cullen", :glitter-index 6}) | |
3 | ||
4 | (defn append | |
5 | [new suspects] | |
6 | (conj new suspects)) | |
7 | ||
8 | (append (mapify (parse (slurp filename))) {:name "Dr acula" :glitter-index 0}) | |
9 | ||
10 | ({:name "Dr acula", :glitter-index 0} {:name "Edward Cullen", :glitter-index 10} {:name "Bella Swan", :glitter-index 0} {:name "Charlie Swan", :glitter-index 0} {:name "Jacob Black", :glitter-index 3} {:name "Carlisle Cullen", :glitter-index 6}) | |
11 | ||
12 | ||
13 | ||
14 | (defn append | |
15 | [new suspects] | |
16 | (conj suspects new)) | |
17 | ||
18 | (append (mapify (parse (slurp filename))) {:name "Dr acula" :glitter-index 0}) | |
19 | ClassCastException clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry clojure.lang.APersistentMap.cons (APersistentMap.java:42) |