On Wed, Jan 5, 2011 at 9:21 PM, Timothy Pratley <timothyprat...@gmail.com>wrote:

> Neat, looks pretty nice.
> I love invitations to nit pick!
> database.clj
> (defn complete-todo [id]
>  (dosync (ref-set *todo* (vec (remove #(= (get % :id) id) @*todo*)))))
> 1) ref-set is unnecessary you could re-factor this to use alter.  The
> result is the same, but semantically set only applies when the new
> value cannot be calculated from the old.
>

I thought the update function to alter had to be able to take

sequence item

so that you could use conj with alter but not cons. and by the same idea,
because remove takes the sequence 2nd, it could be used w/ alter.

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