Hi,

On Sun, Feb 28, 2010 at 06:29:13AM -0800, Jarkko Oranen wrote:

> 3) The reduce needs an empty map as an init value. Otherwise you get
> an exception (You might even want to populate it with empty vectors,
> but it's not necessary since conjing to nil produces a list)

Quiz time: What is the difference between the following?

  (reduce #(update-in %1 [:a] conj %2) {} [1 2 3])
  (reduce #(update-in %1 [:a] conj %2) {:a []} [1 2 3])

The difference might or might not be of importance.

Sincerely
Meikel

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

Reply via email to