specter

Latest version: 1.1.3
spieden 2018-04-18T20:53:28.000556Z

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]

2018-04-18T21:04:33.000368Z

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

2018-04-18T21:04:38.000277Z

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

spieden 2018-04-18T21:04:56.000413Z

cool thanks! @drowsy

2018-04-18T21:05:39.000361Z

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

spieden 2018-04-18T21:09:54.000233Z

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

spieden 2018-04-18T21:10:08.000400Z

s/to/what to/