Hi Andy,

On Fri, Jun 8, 2012 at 1:44 PM, Andy L <andy.coolw...@gmail.com> wrote:

> On 06/07/2012 09:22 PM, Ambrose Bonnaire-Sergeant wrote:
>
>> Every Seqable is not Sequential.
>>
>> (sequential? {:a 1}) => false
>>
>
> Is there a simple test for sequable?


No. I assume you mean seqable.

If it did exist, it would look something like:

(defn seqable?
  "True if (seq a) does not throw an exception"
  [a]
  (or (instance? Seqable a)
       (instance? String a)
       (instance? java.util.Map a)
       (.isArray (class a))  ;pseudocode
       (instance? Iterable a)
       ...))

Thanks,
Ambrose

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