specter

mlimotte 2025-03-27T16:55:23.352929Z

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] 

nathanmarz 2025-03-27T17:21:13.925059Z

that navigates to each subsequence, so FIRST gets the first element of each subsequence

nathanmarz 2025-03-27T17:21:33.143659Z

you can do [(subselect (continuous-subseqs ...)) FIRST]

mlimotte 2025-04-08T14:40:31.320119Z

Helpful. Thank you.