If I have a function like this:
\function has.picture() [get[avatar]!match[empty.png]]
I can use it in a filter like this:
[tag[Member]has.picture[]]
(oops, see Springer’s initial response!)
or like
[tag[Member]] :filter[has.picture[]]
But is there a clear way to invert the behavior, using this function? That is, I want to collect the list of Members who don’t have a non-empty image, and I’d love to reuse this function to do so.
I know I can simply create another function, and that’s what I’ve done for now (\function has.no.picture() [get[avatar]match[empty.png]]
.) But I’m wondering why my initial approaches didn’t work.
I wasn’t particularly surprised when this didn’t work:
[tag[Member]!has.picture[]]
<!-- ^--------- NOTE the "!" -->
But I was expecting this to work fine:
[tag[Member]] :except[has.picture[]]
or this:
[tag[Member]] -[tag[Member]has.picture[]]
or possibly this:
[tag[Member]] :filter[has.picture[]then[]else[yes]]
None of them work; they all return the full list of Members, even though a quarter of them are skipped when I use [get[Member]has.picture[]]
. I can’t see why. Can someone explain?