Currently, if we want to filter an array we need to use %var(#?pattern), then loop over the indices returned and construct a new array. Another suggestion already exists to get rid of that loop by allowing %var(1,5,7) to return an array with just those indices and I agree that'd be a nice improvement. There it is then suggested that we could then use %var(%var(#?pattern)) to filter an array. However, I think for that special case we can do even better.
We currently already have %var(#>)/%var(>) and %var(#<)/%var(<), where the version with # returns the index and the other the value,