On Jun 7, 1:49 pm, Bruce Durling <b...@otfrom.com> wrote:
> Steve and Jon,
>
> On Mon, Jun 7, 2010 at 12:43, Steve Purcell <st...@sanityinc.com> wrote:
> > Empty seqs are logically true, so your "if" condition is always true.
>
> I was looking at that today too. I did (> 0 (count my-list)) in my if
> statement to fix it.

Be aware that counting a list is an O(n) operation (since it needs to
walk all the links in the list). The preferred way to test if any seq-
able thing is empty is (empy? thing) and the already mentioned (seq
thing) to test if it's not empty.

Joost.

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