Fork me on GitHub
#luminus
<
2016-08-12
>
jethroksy03:08:42

hey, I'm stumped on something, hopefully someone can see my error.

jethroksy03:08:11

i'm following Web Development with Clojure (2nd Ed), but with some of my own amendments

jethroksy03:08:57

(defn register! [register-fields errors]
  (reset! errors (registration-errors @register-fields))
  (for [e @errors]
    (println e)))

jethroksy03:08:21

(registration-errors @register-fields) returns a vector

jethroksy03:08:34

so the errors atom is reset to its value

jethroksy03:08:54

if i do (println @errors)I can see the values

jethroksy03:08:15

but the for loop isn't printing anything

jethroksy03:08:41

I can't figure out the reason for this behaviour

jethroksy03:08:18

oh I fixed it, thanks anyway

jethroksy03:08:38

turns out I didn't construct my closure properly