Hi Tones and Eric,
I greatly appreciate your detailed replies! Reading through them clears it
up for me thank you.
It may be useful to add this sort of clarification to official
documentation - the motivations behind some of the more complex filter
operators. If anyone feels it's appropriate for me to request this as an
open issue on github, please let me know.
The "filter" filter operator in particular is difficult to search for, due
to its identical naming to the parent concept of a filter, and other
related naming concepts like the "filter" filter run prefix.
Thanks!
On Sunday, August 1, 2021 at 3:05:31 AM UTC-7 Eric Shulman wrote:
> Here's a demonstration of the difference:
>
> 1) Create three tiddlers named A, B, and C, with text content "this is A",
> "this is B" and "this is C", respectively.
>
> 2) Create a Test tiddler containing:
> <$vars F="[get[text]match[this is B]]">
>
> subfilter result 1 is: <$text text={{{ [enlist[A B C]subfilter<F>] }}}
> /><br>
>
> <$list filter="[enlist[A B C]get[text]match[this is B]]" variable="result">
> subfilter result 2 is: <<result>>
> </$list>
>
> filter result 1 is: <$text text={{{ [enlist[A B C]filter<F>] }}} /><br>
>
> <$list filter="[enlist[A B C]]">
> <$list filter="[<currentTiddler>get[text]match[this is
> B]then<currentTiddler>]" variable="result">
> filter result 2: is <<result>>
> </$list>
> </$list>
>
> 3) The output will be:
> *subfilter result 1 is: this is B*
>
> *subfilter result 2 is: this is B*
>
> *filter result 1 is: B*
>
> *filter result 2: is B*
>
> The difference:
>
> - *subfilter* applies filter F to each input title and returns the
> TEXT that matches "this is B", and is *equivalent to inserting filter
> F into a larger filter expression*
> - *filter *applies filter F to each input title and returns the TITLE
> whose text matches "this is B" and is *equivalent to writing nested
> filters*
>
> hope this helps...
>
> -e
>
>
--
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/91bd18da-ea75-4972-9761-99e946e31420n%40googlegroups.com.