A sequence is an abstraction, not a nodule. Some nodules that you can use through abstraction of a sequence have a way to find the position of a subsequence (for example, strings and java collections), but sequences generally do not do this, since the base nodule should not have an index.
. map-indexed.
, () () . 1, :
(defn find-pos
[sq sub]
(->>
(partition (count sub) 1 sq)
(map-indexed vector)
(filter
(map first)))
=> (find-pos [:a :b \c 5 6 :foo \g :h]
[\c 5 6 :foo])
(2)
=> (find-pos "the quick brown fox"
(seq "quick"))
(4)
, -, . , , .