With (2) below, I was expecting to get the first continuous subsequence, as opposed to the first element of each subsequence. (1)
(sp/select [(sp/continuous-subseqs (fn [x] (.startsWith (name x) "a")))]
[:a :B :a2 :a3 :D])
; => [[:a] [:a2 :a3]]
(2)
(sp/select [(sp/continuous-subseqs (fn [x] (.startsWith (name x) "a")))
sp/FIRST]
[:a :B :a2 :a3 :D])
; => [:a :a2]
Any hints on the best way to think about this, to understand/predict this behavior?.
And how can I accomplish my goal (1st subsequence), i.e.:
; => [:a]
that navigates to each subsequence, so FIRST gets the first element of each subsequence
you can do [(subselect (continuous-subseqs ...)) FIRST]
Helpful. Thank you.