edn files in Clojure

less than 1 minute read

Notes

1
2
3
4
5
6
7
8
;; edn_file.clj

(require '[clojure.edn :as edn])

(def spell-numbers
  (edn/read-string (slurp "spell_numbers.edn")))

(spit "spell_numbers.edn" (prn-str (assoc spell-numbers 4 "Four")))

spell_numbers.edn

{1 "One", 2 "Two", 3 "Three"}

Updated: