Map actually doesn't do anything at all. It simply creates a new lazy
sequence. Instead of map, use doseq and you'll get the result you
expect. Since you actually never print the result of the map, the lazy
sequence is just thrown away, and f is never called, hence never
evaluates.

Timothy

> For example, the following program when evaluated (I'm
> running Clojure 1.3) returns "wrong".
>
> (let [f (fn [x] (if (= x 10)
>                     (throw (new RuntimeException "error!"))
>                     "right"))]
>     (map f (list 10))
>     "wrong")

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