On Nov 3, 4:18 am, Ben Smith-Mannschott <[email protected]> wrote: > On Thu, Nov 3, 2011 at 03:14, Alex Baranosky > > <[email protected]> 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.
user> (seq? ()) true user> (empty? ()) true user> (= () nil) false user> (isa? clojure.lang.PersistentList$EmptyList clojure.lang.ISeq) true Seqs can definitely be empty. The guarantee is only that if you call the seq *function* you will never get out a seq which is empty. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. 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
