I was thinking exactly the same thing. It feels like there should be a better way than instance? ...Sequable. Unless there's a reason that's a bad idea.
Chris On Jul 27, 6:49 pm, Sean Devlin <francoisdev...@gmail.com> wrote: > Rich, > > There have been a few times in this thread that people have tried to > determine if a function was seqable, and used the following code > > (seq? a-collection) > > While this code is great for determining if a-collection is a > sequence, it is sometimes not what people want. Often the following > code is meant to be used: > > (instance? clojure.lang.Seqable a-collection) > > I speculate that many people have something like the following code in > their library collection: > > (defn seqable? > "Returns true if (seq x) should work. That is, it tests if x > implements clojure.lang.Seqable" > [x] > (instance? clojure.lang.Seqable x)) > > Could something like seqable? be added to core? Am I mistaken in the > need for standardizing this function? > > Sean > > PS - Sorry if this isn't the right avenue for feature requests. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---