Fork me on GitHub
#specter
<
2023-05-22
>
itaied09:05:14

How can I collect the depth of a nested vector? For example

(def TABLE
  (recursive-path
   [] p
   [(cond-path
     vector? (sp/stay-then-continue ALL p)
     map? [(submap [:rows :columns])
           MAP-VALS
           (pred vector?)
           [ALL p]])]))
(select TABLE {:rows [[1 [2]]]} results in [[1 [2]] [2]] . I would like to send to the transformation function the depth of each element (for example, [1 [2]] depth is 2, and [1] depth is 3.

nathanmarz17:05:43

that's possible with collect-one or VAL

👍 2