Hi,

On 18 Nov., 03:01, Adam Jones <[EMAIL PROTECTED]> wrote:
> I'm in the middle of writing some code to extract sql results, which
> means I'm doing a *lot* of forcing right now. It's almost enough for
> me to wish there was a convention (and provided definitions) for
> denoting lazy/strict versions of functions. (e.g. (map f ...) is a
> lazy seq, (map! f ...) is strict)

For what it's worth: I use the following convention.

- For code which is purely done for side-effects, I use doseq. eg.
    (doseq [x some-seq] (println x))

- In case I want to have the seq in memory, or there are side-effects
  and I need the actual results, I use doall.
    (doall (map some-f some-seq))

On the other hand: you can simply create your own map!.
  (def map! (comp doall map))

Just my 0.02€.

Sincerely
Meikel


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to