I have these tiddlers
aaa
tagged foo
bbb
tagged foo
and tagged bar
ccc
tagged bar
These two filter expressions result in partially identical output. (Never mind that the testing if a tiddler that is tagged foo has the tag foo. That is not the issue.)
<$list filter='[tag[foo]] :map[<currentTiddler>tag[foo]]'/>
<$list filter='[tag[bar]] :map[<currentTiddler>tag[bar]]'/>
…result in:
aaa
bbb
bbb
ccc
I want to merge these two filters to avoid duplicate output. But if I naively do:
<$list filter='
[tag[foo]] :map[<currentTiddler>tag[foo]]
[tag[bar]] :map[<currentTiddler>tag[bar]] '>
</$list>
…then the second :map
also operates on the output from the first filter run and removes aaa
.
In my real case, I do need to use the :map
filter prefix because the preceding filter steps are more complex, so the :map
operations must not be omitted (…AFAICT)
QUESTION: Can the second :map
be restricted to only operate on the things in its own filter run?
Here’s a TW with the above that I test on.
Various attempts:
Bracketing the second run gives syntax error
:
[tag[foo]] :map[<currentTiddler>tag[foo]] [[tag[bar]] :map[<currentTiddler>tag[bar]]]
I think the following syntax would make a lot of sense, i.e to omit the space before :map
to indicate that it should operate only on the direct output from the previous step… but nope:
[tag[foo]] :map[<currentTiddler>tag[foo]]
[tag[bar]]:map[<currentTiddler>tag[bar]]
…nor…
[tag[foo]] :map[<currentTiddler>tag[foo]]
[tag[bar]:map[<currentTiddler>tag[bar]]
…and this I guess the following only maps currentTidder
onto the current tiddler and thereafter checks if it is tagged bar
… but I’m not sure why there is no output:
[tag[foo]] :map[<currentTiddler>tag[foo]]
[tag[bar]:map<currentTiddler>tag[bar]]
…
Anyway, is there a way to scope filter prefixes?