Fork me on GitHub
#specter
<
2017-06-29
>
enn15:06:28

Hello … I’m wondering if I’m missing an obvious way to do sorting and/or selecting minimum/maximum values with Specter? I think I could do it with view or transformed and a function that takes the whole array and just does the min/max in Clojure, but is there a more Specter-y (spectral?) way?

enn16:06:57

Hmm, it looks like view or transformed will not do what I want because the provided functions get applied to each value matching my ALL selector, rather than the sequence of matching values.

nathanmarz16:06:22

@enn if it's not already sorted in your data structure, you would need to do (view sort)

nathanmarz16:06:13

if the values are spread throughout your data structure (not together in a sequence), you can first do (subselect <path>) to manipulate them as a single sequence

enn16:06:29

@nathanmarz aha, thank you, I will look at subselect