Fork me on GitHub

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?


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.


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


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


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