On Dec 14, 2:08 pm, Randall R Schulz <rsch...@sonic.net> wrote:
> Hi,
>
> I ran into a special case that I'd like to avoid. When (filter ...) is
> either applied to an empty collection or the filter predicate returns
> false for all the elements in the supplied collection, filter returns
> nil.
>
> Would it be acceptable and desirable for it to return and empty list in
> this case?
>
No.
The seq protocol says either there is a sequence of at least one
thing, or no sequence - nil. There is no such thing as an empty seq,
and no reason sequence functions should start returning empty
collections of any type.
Rich
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---