Fork me on GitHub
#specter
<
2017-05-13
>
ksmithbaylor00:05:42

Is there a way to implement NONE removal for walker? There are a lot of types of entities in the db and they all use the same flag for signifying something as inactive.

ksmithbaylor00:05:39

Also, the inactive entities always appear in vectors. Would it make sense to wrap the setval above in a transform that would filter each vector to remove NONE?

nathanmarz01:05:16

@ksmithbaylor i don't think it would be too hard to re-implement walker in terms of recursive-path, ALL, etc.

nathanmarz01:05:00

you could also use [(walker vector?) ALL (pred :inactive)] as your path, and NONE removal will work

nathanmarz01:05:57

actually that would need to be wrapped in recursive-path so it reaches vectors nested inside maps inside vectors

ksmithbaylor21:05:14

Since I'm fairly new to Clojure, I'm not quite clear on the usage of recursive-path. Here's what I have so far, but it seems to have no effect on the data:

(setval (recursive-path [] p [(walker vector?) ALL (pred :inactive) p]) NONE data)