It already exists, and has exactly the same name. The package is clojure.lang
.
To use it, just call seq
on the array - the result will be an instance of ArraySeq
that wraps the array.
Note that the array is not copied so it shouldn't be modified by something else. Also, for primitive types there are custom classes, e.g. ArraySeq_int
, but it's just an implementation detail - just letting you know so you don't start checking for (instance? clojure.lang.ArraySeq x)
.