On Mon, Dec 13, 2010 at 3:27 PM, Alan <a...@malloys.org> wrote:
> That function is already written for you.
>
> user=> (def x (atom (with-meta [] {:foo 1})))
> #'user/x
> user=> (meta @x)
> {:foo 1}
> user=> (swap! x vary-meta assoc :bar 2)
> []
> user=> (meta @x)
> {:bar 2, :foo 1}

Not exactly. My swap-meta! is a bit more concise to use. (Where did
you find vary-meta? There seems to be a lot of stuff that's there, but
hardly anyone knows about.)

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