When you want to iterate over things and perform a side-effecty action for 
each one (logging is a side effect, as would be adding event listeners to 
DOM nodes, changing CSS classes, etc), doseq is usually the clearest thing 
to do:

(defn listen-to
  [links]
  (doseq [link links]
    (.log js/console link) links))

You almost never want to use map for side effects.  A good rule of thumb is 
that if you don't use the return value from map, you probably want doseq 
instead.

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