It's a shame that the intersection operator doesn't follow the rule of sets.

The intersection of the empty set with another set should be the empty set.

So this should work:

<$list 
filter="[all[current]!tag[Reaction]!has[a-actions]has[m-components]]+[!isblank[]list[!!m-components]count[]compare:number:eq[1]]"
 
emptyMessage="NO ICON">
ICON 1
</$list>

But it doesn't. It always wants to generate whatever happens after the + 
even though nothing that is generated following the +  matches the first 
set. 

So instead you have to break it out into two list widgets:

<$list 
filter="[all[current]!tag[Reaction]!has[a-actions]has[m-components]]" >
<$list filter="[list[!!m-components]count[]compare:number:eq[1]]"> 
ICON 2
</$list>
</$list>


HTH

On Wednesday, August 5, 2020 at 11:17:29 AM UTC-7, Mark Green wrote:
>
> Here's what I want to write in a filter:
>
> If the current tiddler 
>  - doesn't have the "reaction" tag
>  - doesn't have an "a-actions" field
>  - has a "m-components" list with one member
>  - then display an extra icon.
>
> I originally wrote this as
>
>
> [all[current]!tag[Reaction]!has[a-actions]list[!!m-components]count[]compare:number:eq[1]]
>
> But this does not work because list[] ignores its input, so even if it's 
> been emptied out by the earlier filters, it still displays the icon if 
> m-components has one member but the tiddler *does* have Reaction or 
> a-actions.
>
> I then tried using a set intersection:
>
>
> [all[current]!tag[Reaction]!has[a-actions]]+[list[!!m-components]count[]compare:number:eq[1]]
>
> But this has the same problem and I'm not sure why, as the first set 
> should be empty. In fact looking at it if it's a set intersection, my 
> reasoning would have been that it would *never* trigger because the 
> second set can only be empty or contain "1", and so unless the tiddler was 
> named "1" that would not be present in the first set and the intersection 
> would be empty. But it seems intersections don't work that way?
>
> How do intersections correctly work and how can I do this?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/da2df29e-ef67-4dee-acc1-0986eaa4127ao%40googlegroups.com.

Reply via email to