(defn
seq
"Returns a seq on the collection. If the collection is\n empty, returns nil. (seq nil) returns nil. seq also works on\n Strings."
[coll]
(when-not
(nil? coll)
(cond
(implements? ISeqable coll)
(-seq coll)
(array? coll)
(when-not (zero? (alength coll)) (IndexedSeq. coll 0 nil))
(string? coll)
(when-not (zero? (alength coll)) (IndexedSeq. coll 0 nil))
(native-satisfies? ISeqable coll)
(-seq coll)
:else
(throw (js/Error. (str coll " is not ISeqable"))))))