Good ππ»ββοΈday
(defn nice? [man] (<= (:hair man) 20))
(defn rayman [man]
(loop [prettier man]
(if (nice? prettier)
prettier
(recur (update prettier :hair dec)))))
(def ray {:hair 100})
(rayman ray)lol
Morning
@otfrom also feel free to post to the channel π
It is a sekrit morning just for us
π€«
Good morning
Good morning π
Good morning β
God morning
me very confused... I do a (edn/read ...) but the type I get back is a string? And when I do this in a little bit of test code I get back clojure.lang.PersistentArrayMap as expected. π€
it turns out the files I was reading were had lines enclosed in "" hence it not working. I just assumed they were correct as previously this had worked, but something must have changed somewhere/sometime.
yes
then why are you expecting to get a map and not a string from read?
surely edn/read returns clojure data? or am I mistaken? (that is how it works for me in the REPL at least)
if what youβre reading starts with a string it will return that string:
(clojure.edn/read-string "\"hello\" {:foo :bar}")
;; => "hello"note that edn/read expects a reader and a reader is stateful
I got one (I think)
(with-open [r (io/reader f)]
(let [data (edn/read {:readers readers} (java.io.PushbackReader. r))]
And it works in other respectsdoes the file youβre reading start with a string?