Fork me on GitHub
#specter
<
2018-04-18
>
spieden20:04:28

is there a way to splice a sequence into another starting at a specific index with specter? e.g.

(spr/setval [(spr/before-index 1)] [:a :b] [:x :y])
=> [:x [:a :b] :y]
; want: [:x :a :b :y]

drowsy21:04:33

@spieden you can use srange to navigate to a subcollection.

drowsy21:04:38

(setval [(srange 1 1)] [:a :b] [:x :y]) => [:x :a :b :y]

drowsy21:04:39

in this case you are navigating to an empty subcollection in the middle and replacing it with something nonempty

spieden21:04:54

yes i had that idea in my head from using sets at some point but didn’t know to look for

spieden21:04:08

s/to/what to/