Hi everyone, I’d like to compare two lists (described by filters) in order to know whether they are equal or if they differ (by at least one item). This may look like an easy problem to solve in one filter, but I have been stuck on this one for too many hours, because the sets may also be empty!
If you know a general recipe, please tell me
If you want to test your solution, here is some wikitext to work on on tiddlywiki.com.
\define set-0_filter()
\define set-1_filter() Open Recent Tools More +[addprefix[$:/core/ui/SideBar/]]
\define set-2_filter() [list[$:/tags/SideBar]]
* set #0={{{ [subfilter<set-0_filter>] ||$:/core/ui/ListItemTemplate }}}
* set #1={{{ [subfilter<set-1_filter>] ||$:/core/ui/ListItemTemplate }}}
* set #2={{{ [subfilter<set-2_filter>] ||$:/core/ui/ListItemTemplate }}}
This naïve solution only works when set 1 is non empty:
''<$list filter="[subfilter<set-1_filter>sort[]join[&]] -[subfilter<set-2_filter>sort[]join[&]]"
emptyMessage="Sets are the same">
Sets differ
</$list>''
Thanks in advance!