Hi Joe > Then a filter that finds A is "[tag[A]]" > > B OR C is "[tag[B]] [tag[C]]" > > A AND B is "[tag[A]tag[B]]" > > A and (B or C) has to be rewritten as > (A and B) or (A and C) and is > > "[tag[A]tag[B]] [tag[A]tag[C]]”
You can directly do A and (B or C) as: [tag[B]] [tab[C]] +[tag[A]] There are three runs here: * The first two are processed in the same way: they start with an implicit [all[tiddlers]] to select all “real” tiddlers (ie, non-shadow tiddlers), whether or not they are system tiddelrs. The [tag[x]] filter operator selects those tiddlers that carry the indicated tag. At the end of processing each run, the results of the run are merged into the accumulator, the temporary holding storage for intermediate results. * The third run starts with a “+” which means that instead of kicking off with all the real tiddlers, it instead uses the accumulator as the input to the run. The [tag[A]] then selects those tiddlers from the accumulator that carry the tag “A”. The results of the third run replace the accumulator, and become the results of the entire filter. The other filter prefixes that are available are “-“ and “~”. The action of minus is that the results of the run are removed from the accumulator (the input to the run is still the list of all “real” tiddlers). The action of tilde is to only evaluate the run if the accumulator is empty; the results of the run then become the accumulator. > Which in a strange way reminds me of horn clauses in Prolog where I'd write: > > ``` > filter(a, b) :- ... > filter(a, c) :- .. > ``` > > So really these filter expressions are equivalent to queries in predicate > logic. > > (which is why they are so powerful :-) Thank you! It’s slightly embarrassing to have to invent something rather than being able to adopt something tried and trusted, so it’s good to hear that it’s not too terrible. Best wishes Jeremy > > Cheers > > /Joe > > > > -- > You received this message because you are subscribed to the Google Groups > "TiddlyWikiDev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tiddlywikidev+unsubscr...@googlegroups.com > <mailto:tiddlywikidev+unsubscr...@googlegroups.com>. > To post to this group, send email to tiddlywikidev@googlegroups.com > <mailto:tiddlywikidev@googlegroups.com>. > Visit this group at https://groups.google.com/group/tiddlywikidev > <https://groups.google.com/group/tiddlywikidev>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywikidev/9b8edbb1-8657-4502-ba5e-c867651203a4%40googlegroups.com > > <https://groups.google.com/d/msgid/tiddlywikidev/9b8edbb1-8657-4502-ba5e-c867651203a4%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikidev+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywikidev@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/84E0AE5D-0B74-44A0-B2F8-F2EB3EF8F144%40gmail.com. For more options, visit https://groups.google.com/d/optout.