On Thu, Oct 18, 2012 at 10:16 AM, larry google groups
<lawrencecloj...@gmail.com> wrote:
> Okay, this is very confusing to me. If I try this:
>
>   (defn add-to-logged-in-registry [this-users-params]
>
>   (let [right-now (. (Date.) getTime)
>         new-user-entry (conj this-users-params { "updated" right-now })]
>     (swap! registry (fn [map-of-user-maps]
>                      (conj map-of-user-maps {:hi new-user-entry})))))
I think you want to use assoc here instead of conj

(assoc map-of-user-maps :hi new-user-entry)

and conveniently, swap! will pass the map to assoc for you, so no need
for the anonymous function

(swap! registry assoc :hi new-user-entry)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to