Hi,
I saw dorun and doall in core.clj as follows:
That is, doall just calls dorun.
My question is, how come doall does force eval and dorun does not.
thanks in advance,
-sun
(defn dorun
([coll]
(when (and (seq coll) (or (first coll) true))
(recur (rest coll))))
([n coll]
(when (and (seq coll) (pos? n) (or (first coll) true))
(recur (dec n) (rest coll)))))
(defn doall
([coll]
(dorun coll)
coll)
([n coll]
(dorun n coll)
coll))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---