Sean <francoisdev...@gmail.com> writes: > And now everything works great. What I don't understand is why the > doseq macro is required instead of the mapping operation. Could > somebody explain why Clojure has this different form for functions > that have side effects?
My take on this is that map supports a functional style of programming, (it takes a function argument, and the focus is on its return value) while doseq is meant for imperative, side-effect-producing code. Both are possible in Clojure, but you should use FP as much as possible as it will result in cleaner, less-buggy code. If doseq and map worked the same way, you would be tempted to use them interchangably. This would be a mistake as they are each suited for vastly different paradigms, despite superficial similarities in the way they work. -Phil --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---