On Thu, Nov 3, 2011 at 03:14, Alex Baranosky
<alexander.barano...@gmail.com> wrote:
> What a coincidence. My instinct would be to make (interleave) return an
> empty seq, instead of nil. I wonder the trade-offs between the two?

There is no such thing as an empty seq. Or put another way, the empty
seq *is* nil. You're probably thinking of an empty list.

;the empty list
user> (list)
()

;the empty seq
user> (seq (list))
nil

Returning nil has the advantage that nil is false in a boolean context.

(when-let [s (apply interleave ...)] ... )

// ben

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