specter

steveb8n 2023-08-25T05:50:29.188699Z

Q: is there a way to “expand” a single value in a sequence with N values? e.g. (transform [ALL #{2} ] (fn [v] [20 20]) [1 2 3]) => [1 20 20 3] I have been trying something like the setval / END technique but can’t figure it out

rolt 2023-08-27T06:25:00.444149Z

(setval [(srange 1 2)] [20 20] [1 2 3])

mmer 2023-08-25T08:09:44.881499Z

I have found that sometimes using specter as an initial transformer and using other functions can often yield result you want, rather than trying to get specter to do it in one step. Hence: (vec(flatten(transform [ALL #{2}] (fn [v] [20 20]) [1 2 3])))

steveb8n 2023-08-25T22:13:18.414979Z

thanks. sometimes I try too hard to use specter paths