clojure-europe 2025-11-29

Good πŸ’‡πŸ»β€β™‚οΈday

🎨 1

(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)

Morning

πŸ‘‹πŸΌ 1

@otfrom also feel free to post to the channel πŸ˜…

It is a sekrit morning just for us

πŸ˜‚ 1

Good morning

Good morning πŸŽ„

Good 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.

πŸ‘ 1

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 respects

does the file you’re reading start with a string?