clojure-europe

ray 2025-11-29T08:55:30.511589Z

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

🎨 1
Thomas Moerman 2025-11-29T09:34:37.839909Z

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

ray 2025-11-29T09:35:46.958409Z

lol

2025-11-29T09:52:58.596729Z

Morning

πŸ‘‹πŸΌ 1
ray 2025-11-29T10:29:00.569289Z

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

2025-11-29T10:29:44.933499Z

It is a sekrit morning just for us

πŸ˜‚ 1
ray 2025-11-29T10:30:20.666219Z

🀫

reefersleep 2025-11-29T12:34:50.045039Z

Good morning

mdiin 2025-11-29T14:56:40.778479Z

Good morning πŸŽ„

lread 2025-11-29T15:26:32.947569Z

Good morning β›„

thomas 2025-11-29T16:34:45.692659Z

God morning

thomas 2025-11-29T16:41:38.357549Z

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. πŸ€”

thomas 2025-12-08T11:53:45.120629Z

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
thomas 2025-12-03T12:36:50.919839Z

yes

mkvlr 2025-12-03T20:02:20.038259Z

then why are you expecting to get a map and not a string from read?

thomas 2025-12-03T20:11:55.173589Z

surely edn/read returns clojure data? or am I mistaken? (that is how it works for me in the REPL at least)

mkvlr 2025-12-03T21:08:44.502989Z

if what you’re reading starts with a string it will return that string:

(clojure.edn/read-string "\"hello\" {:foo :bar}")
;; => "hello"

borkdude 2025-11-29T16:43:53.182549Z

note that edn/read expects a reader and a reader is stateful

thomas 2025-11-29T16:48:41.654999Z

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

mkvlr 2025-11-29T23:52:10.531429Z

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