Tiddlywiki5: [BUG]? named prefixes use of :AND or +[run] confusing 5.1.23 Pre-release comment

Created on 29 Oct 2020  ·  4Comments  ·  Source: Jermolene/TiddlyWiki5

Describe the bug
Actually questioning the use of the new named prefix :and
From various discussions with forum members the AND is a problematic one in filter in part because it is intrinsic.
eg [[title1]] [[title2]] or [run1] [run2] is AND

To Reproduce
Read https://tiddlywiki.com/prerelease/#Filter%20Expression

The fact is the AND operation occurs with multiple runs

Consider a "true" AND is as follows
[run1] [run2] [run3]

or even
=[run1] =[run2] =[run3]

May I suggest that the :and[run] named prefix be renamed
:also[run] because this;

  • Reflects an intersection better than AND
  • It will not distract from the real AND which occurs between runs.
  • We should even document this "unstated" AND

Regards
TonyM

Most helpful comment

As the person who suggested the :and name, I should probably chime in. :grinning:

The names :and, :or, and :else are supposed to refer to the logical operators, so if you have the run [is[image]] :and[is[orphan]] its output will be all tiddlers that are images AND are "orphans" (nothing is linking to them).

When you talk about a "true" AND, what you are referring to is the English-language meaning: "I want this tiddler AND that tiddler". E.g., the filter expression [[this tiddler]] [[that tiddler]], which produces both of the named tiddlers. But that's the opposite meaning to how the term AND is used in logic. If you wrote the filter expression [[this tiddler]] :and[[that tiddler]] it would always be empty, because there is no tiddler whose title is both "this tiddler" and "that tiddler" at the same time.

Perhaps the explanation doesn't quite make it clear enough that the words "and" and "or" in the filter run prefixes are being used in their technical / logical meaning (the title must match condition A and condition B). The table is labeled "In technical / logical terms: (list of prefixes)", but maybe a paragraph needs to be added above the table with a slightly fuller explanation? Your complaint about the logical-English meaning of the word "AND" being used (rather than the plain-English meaning that you used in your issue description) certainly suggests that some people could benefit from such an explanation, as it seems the intent was not clear to you.

All 4 comments

As the person who suggested the :and name, I should probably chime in. :grinning:

The names :and, :or, and :else are supposed to refer to the logical operators, so if you have the run [is[image]] :and[is[orphan]] its output will be all tiddlers that are images AND are "orphans" (nothing is linking to them).

When you talk about a "true" AND, what you are referring to is the English-language meaning: "I want this tiddler AND that tiddler". E.g., the filter expression [[this tiddler]] [[that tiddler]], which produces both of the named tiddlers. But that's the opposite meaning to how the term AND is used in logic. If you wrote the filter expression [[this tiddler]] :and[[that tiddler]] it would always be empty, because there is no tiddler whose title is both "this tiddler" and "that tiddler" at the same time.

Perhaps the explanation doesn't quite make it clear enough that the words "and" and "or" in the filter run prefixes are being used in their technical / logical meaning (the title must match condition A and condition B). The table is labeled "In technical / logical terms: (list of prefixes)", but maybe a paragraph needs to be added above the table with a slightly fuller explanation? Your complaint about the logical-English meaning of the word "AND" being used (rather than the plain-English meaning that you used in your issue description) certainly suggests that some people could benefit from such an explanation, as it seems the intent was not clear to you.

Thanks @AnthonyMuscio @rmunn perhaps the critical point is that the ":and" here refers to runs not individual items.

My bad @rmunn

@Jermolene and when dealing with runs we are referring to sets?

I suppose the issue is with filters we are more dealing with sets and and empty sets. As a result perhaps we could either document the set equivalents and/or have operators that represent set manipulation.

_The mathematical notion of a set involves no duplication, so that if we have a series containing 4 elements, “a”, “a”, “c” and “b”, the set formed by the members of this series contains three members, namely “a”, “c” and “b”._

The union and intersection of sets may be an appropriate language to cater for, since this is the way filters operate. Although I dare say we will need to "document" it a little to support the various user groups that make use of Tiddlywiki.

I will investigate further. And let this issue stand for a little while in case there is any feedback.

I have some ideas to use the existing methods.

Tony

Too much onm my plate and many ways to achive this so I will close it to keep the Queue sorter :)

Was this page helpful?
0 / 5 - 0 ratings