I think you may be looking for :intersection?

   - named prefix :intersection replaces all filter output so far with 
   titles that are present in the output of this run, as well as the output 
   from previous runs. Forms the input for the next run.  NEW IN: 5.1.23

See the examples for filter runs 
<https://tiddlywiki.com/#Filter%20Run%20Prefix%20(Examples)> for a full 
explanation of the difference.

On Wednesday, June 16, 2021 at 3:36:47 AM UTC-5 jn.pierr...@gmail.com wrote:

> I've been into toying with run prefixes for my filters, to see what I can 
> now do with them.
>
> I've been able to have an equivalent of "if not A then B" but I've not 
> been able to get "if A then B". the + or :and prefix is not a logical AND 
> at all but just a way to replace all currents stuff in the pipe with new 
> contents.
>
> Part of the problem is I can't produce NOT A. I mean, see this example:
>
> {{{
> cobalt great gaz :filter[split[]match[r]] 
> +[!is[blank]then[]else["great" void]]
> ~Expected
> }}}
>
> {{{
> cobalt fox gaz :filter[split[]match[r]] 
> +[!is[blank]then[]else["fox" void]]
> ~Unexpected
> }}}
>
> The only output is "fox" void. I expected that the first filter output be 
> Expected.
>
> As a kind of check with
>
> {{{
> cobalt great gaz :filter[split[]match[r]] 
> ~Expected
> }}}
>
> {{{
> cobalt fox gaz :filter[split[]match[r]] 
> ~Unexpected
> }}}
>
> the output is
> great
> Unexpected
> which is totally what we thought we should have.
>
> The same also happens with
>
> cobalt great gaz :filter[split[]match[r]]
> +[!is[blank]]
> ~Expected
> }}}
>
> {{{
> cobalt fox gaz :filter[split[]match[r]]
> +[!is[blank]]
> ~Unexpected
> }}}
>
> Again, that's OK. Maybe that's because [] is not a blank input? But 
>
>
> {{{ [[]] +[!is[blank]then[Full]else[Empty]] }}}
>
> does indeed output Empty as expected so I'm really confused now...
>
> BTW, in real life, in "if A then B" my B is not a constant, in which case 
> I would have used [A]!is[blank]then[B] but a complex run. I know I can have 
> a function or variable as my B to get around the difficulty, but that is 
> not what I want to do here.
>
> -- 
> Jean-Pierre
>
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/438fc0c3-4fd7-4f15-8c5d-03440ce66fffn%40googlegroups.com.

Reply via email to