On Wed, Feb 25, 2009 at 7:29 AM, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> Am 24.02.2009 um 22:25 schrieb Mark Volkmann:
>
>> Right. That's what I'm doing now ... in many places. I was just asking
>> if there is a single function that combines them. It seems reasonable
>> to have one since those to functions seem to be called together a lot.
>
> That's interesting. I almost never use doall or dorun together with
> map. I found that most side-effects don't give interesting result values.
> And generating a lazy seq of nils which is then realized seems
> ugly to me.
>
> Using doall together with map is maybe also a sign to check whether
> it's possible to split the side-effects and result generation.

I mainly use it for adding temporary debugging code to a source file.
For example, if I want to verify the contents of a vector and I want
each item to be output on a single line, I might do this.

(dorun (map #(println %) my-vector))

Of course the dorun call isn't needed in a REPL.

-- 
R. Mark Volkmann
Object Computing, Inc.

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

Reply via email to