specter

Latest version: 1.1.3
roklenarcic 2019-02-21T11:48:24.000700Z

Is there some way to say STAY if SUBPATH 1 and SUBPATH 2 match

roklenarcic 2019-02-21T11:48:43.001200Z

I cannot find a way to check if two subpaths are both present

roklenarcic 2019-02-21T11:49:16.001800Z

to implement collecting an item if prop1 = x and prop2 = y

roklenarcic 2019-02-21T12:04:13.002200Z

used multiple selected? to accomplish that

eoliphant 2019-02-21T22:29:46.004500Z

hi I’m trying to figure out how exactly INDEXED-VALS works. Like the example . For say [0 1 2 3 4], I want to move say the 3 at index 3, to say the 0th or some other index. The select is clear to me, basically like map-indexed. But I’m not quite grokking what’s happening in the setval example. This looks like it would do something like set all the indicies to 0. (sp/setval [sp/INDEXED-VALS sp/FIRST] 0 [0 1 2 3 4]) but say (sp/setval [sp/INDEXED-VALS sp/FIRST 2] 0 [0 1 2 3 4]) would move 2 to the front of the list. That’s obviously not how it works lol

nathanmarz 2019-02-21T22:57:46.005300Z

it traverses the values in order, so it moves them all to index 0 in order, having the effect of reversing the vector

nathanmarz 2019-02-21T22:57:57.005600Z

you can move just one particular value like this:

user=> (setval [INDEXED-VALS (selected? LAST (pred= 3)) FIRST] 0 [0 1 2 3 4])
[3 0 1 2 4]

nathanmarz 2019-02-21T22:58:32.006100Z

but index-nav is better for moving one value at a specific position:

user=> (setval (index-nav 3) 0 [0 1 2 3 4])
[3 0 1 2 4]