Fork me on GitHub
#specter
<
2019-08-06
>
jsa-aerial16:08:37

I think I'm confused.

nathanmarz16:08:40

filterer navigates to a sequence of all "locations" in the sequence matching the predicate

nathanmarz16:08:53

with index 0 being the first location, index 1 being the second, and so on

nathanmarz16:08:12

transformations to the sequence navigated to by filterer can only affect those locations

nathanmarz16:08:51

increasing the size of the sequence just causes indexes past the last location to be ignored

nathanmarz16:08:26

there's a special case for when you reduce the size of the sequence to set the removed locations to NONE

jsa-aerial17:08:41

Hmmmm, OK. So, there is no 'obvious / out of the box' way to insert? Using a combo of index-vals and before-index works fine, is that the 'right way' to do this?

nathanmarz17:08:43

zipper navigators are good for this use case

nathanmarz17:08:09

com.rpl.specter.zipper

nathanmarz17:08:28

user=> (setval [z/VECTOR-ZIP (z/find-first #(= "b" %)) z/INNER-LEFT] [77] ["a" "b" "c"])
["a" 77 "b" "c"]

jsa-aerial18:08:42

Presumably that is much more efficient as well?

nathanmarz18:08:28

zippers do have overhead

nathanmarz19:08:05

the com.rpl.specter.zipper namespace is not totally fleshed out, so there are other navigators that could be added to make it more efficient

✔️ 4
nathanmarz19:08:30

such as the zipper equivalent of before-index instead of doing INNER-LEFT

lellis19:08:54

Hi All, i have a question. Why when use this symbol ’[?e :a true] inside a select nav its resolve to [?e :a G__161070]? ex: (select [ALL (pred #(= (log/spy %) (log/spy '[?e true])))] ['[?e true]]) return [].