On Jun 28, 1:49 am, Richard Newman <holyg...@gmail.com> wrote: > >> cons is acting according to its documentation. > > > It's list? that isn't. > > That's not strictly true
Are you calling me a liar? > Is there a reason why you are testing for listiness rather than for > some other property, like Sequential? It's generally considered good > form in Clojure to program against the native abstractions (such as > sequences) rather than particular concrete types. It's for a code-manipulating macro. It needs to treat () colls differently from [] ones, in particular. I note that sequential? returns true for vectors. While it starts with inputs like '(foo bar (baz quux)) it takes those apart and puts them back together again in various ways, sometimes using cons to prepend an item. It also sometimes uses map, whose return values also fail list?. If you don't think list? should be true for all () collections, or at least all finite ones, perhaps the core should contain a function that is? We have set?, vector?, and map? for [], #{}, and {} collections respectively that exactly distinguish them from others. But for () collections we only seem to have #(and (sequential? %) (not (vector? %))). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---