On Tue, Aug 31, 2010 at 11:08 AM, Justin Kramer <jkkra...@gmail.com> wrote:
> Another tip: per the doc for 'empty?', (seq s) is preferred over (not
> (empty? s)). Oh, and 'str' isn't necessary since 'println' adds spaces
> between arguments:
>
> (defn printall [s]
>  (when (seq s)
>   (println "Item:" (first s))
>   (recur (rest s))))

Good tips!  Another option:

(defn printall [s]
  (doseq [i s]
    (println "Item:" i)))

--Chouser
http://joyofclojure.com/

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