|
|
@ -43,7 +43,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
(defn lines->entries [lines]
|
|
|
|
(defn lines->entries [lines]
|
|
|
|
(var entries @[])
|
|
|
|
(var entries @[])
|
|
|
|
(loop [line :in lines]
|
|
|
|
(loop [line :in lines
|
|
|
|
|
|
|
|
:when (> (length line) 0)]
|
|
|
|
(let [[key content] (string/split ":" line)
|
|
|
|
(let [[key content] (string/split ":" line)
|
|
|
|
kwkey (keyword key)]
|
|
|
|
kwkey (keyword key)]
|
|
|
|
(when (or (= "id" key)
|
|
|
|
(when (or (= "id" key)
|
|
|
@ -85,8 +86,11 @@
|
|
|
|
(readline))
|
|
|
|
(readline))
|
|
|
|
|
|
|
|
|
|
|
|
(defn new-id []
|
|
|
|
(defn new-id []
|
|
|
|
(inc (max ;(map (fn [e] (scan-number (e :id)))
|
|
|
|
(inc (or (max ;(map (fn [e]
|
|
|
|
(load-entries)))))
|
|
|
|
(scan-number
|
|
|
|
|
|
|
|
(get e :id "0")))
|
|
|
|
|
|
|
|
(load-entries)))
|
|
|
|
|
|
|
|
0)))
|
|
|
|
|
|
|
|
|
|
|
|
(defn add []
|
|
|
|
(defn add []
|
|
|
|
(-> (load-entries)
|
|
|
|
(-> (load-entries)
|
|
|
|