Re: check if something can be coerced to a seq

2011-01-17 Thread Stuart Sierra
The problem with a seq-able? predicate is that the definition of what is seq-able is often context-dependent. `seq` works on Strings, but you probably don't want `flatten` to turn a String into a sequence of characters. -S clojure.com -- You received this message because you are subscribed

Re: check if something can be coerced to a seq

2011-01-17 Thread Jürgen Hötzel
2011/1/17 Stuart Sierra the.stuart.sie...@gmail.com The problem with a seq-able? predicate is that the definition of what is seq-able is often context-dependent. `seq` works on Strings, but you probably don't want `flatten` to turn a String into a sequence of characters. Good point. There

check if something can be coerced to a seq

2011-01-16 Thread Jürgen Hötzel
Hi, I came across this issue while implementing a lazy, efficient flatten that also uses the whole sequence abstraction (flatten java arrays). The problem with (seq x) is, that it will throw an Exception if called on something, that cannot be coerced to sequence, so I just used sequencial?

Re: check if something can be coerced to a seq

2011-01-16 Thread Ken Wesson
On Sun, Jan 16, 2011 at 6:22 AM, Jürgen Hötzel juer...@hoetzel.info wrote: Hi, I came across this issue while implementing a lazy, efficient flatten that also uses the whole sequence abstraction (flatten java arrays). The problem with (seq x) is, that it will throw an Exception if called