if not bug is an issue: mathematics operator

62 views
Skip to first unread message

Mohammad

unread,
Jan 4, 2020, 2:33:24 PM1/4/20
to tiddl...@googlegroups.com
In Tiddlywiki.com type below examples in new tiddlers:

  • <$list filter="[add[0]]"/>

  • <$list filter="[multiply[0]]"/>

Is this a small issue?

Eric Shulman

unread,
Jan 4, 2020, 3:11:25 PM1/4/20
to TiddlyWiki
On Saturday, January 4, 2020 at 11:33:24 AM UTC-8, Mohammad wrote:
In Tiddlywiki.com trye below examples:

  • <$list filter="[add[0]]"/>
  • <$list filter="[multiply[0]]"/>

Is this an small issue?

What is happening is that, by default, a filter starts with an implied "all[tiddlers]".
Non-numeric list items (such as tiddler titles) have a value of 0.
At TiddlyWiki.com, there are 1304 non-shadow tiddlers.  
Thus, each of the above filters is producing 1304 numeric results.

This seems consistent and correct to me.  What do you want the results to be?

-e

Mohammad

unread,
Jan 4, 2020, 3:17:59 PM1/4/20
to TiddlyWiki
Hello Eric,


On Saturday, January 4, 2020 at 11:41:25 PM UTC+3:30, Eric Shulman wrote:
On Saturday, January 4, 2020 at 11:33:24 AM UTC-8, Mohammad wrote:
In Tiddlywiki.com trye below examples:

  • <$list filter="[add[0]]"/>
  • <$list filter="[multiply[0]]"/>

Is this an small issue?

What is happening is that, by default, a filter starts with an implied "all[tiddlers]".

That is the reason!
 
Non-numeric list items (such as tiddler titles) have a value of 0.
At TiddlyWiki.com, there are 1304 non-shadow tiddlers.  
Thus, each of the above filters is producing 1304 numeric results.

This seems consistent and correct to me.  What do you want the results to be?

With respect to part one, this is understandable. 

NOT sure if it is already in documentation! Worth to be added.

-e

TonyM

unread,
Jan 5, 2020, 1:51:32 AM1/5/20
to TiddlyWiki
Mohammad,

the Larger point is all filters act on a set of titles, the default is as Eric said, is all[tiddlers]

When I first read your examples, I immediately saw you have not defined the scope of this set and it would thus default to all[tiddlers]

You no doubt often start a filter with all[current], !is[system] etc... which is the first step to limit the size of the set of titles to be used by the filter.

I feel it is this concept which may need to be documented, rather than all the possible "invalid" cases one could write, like you adding 0 to every title.

Regards
Tony

Mohammad

unread,
Jan 5, 2020, 8:27:54 AM1/5/20
to TiddlyWiki
Tony!
 Thanks for explanation! I have added Eric and your description to TW-Scripts.

--Mohammad

Mohammad

unread,
Jan 5, 2020, 8:33:54 AM1/5/20
to TiddlyWiki


On Sunday, January 5, 2020 at 10:21:32 AM UTC+3:30, TonyM wrote:
Mohammad,

the Larger point is all filters act on a set of titles, the default is as Eric said, is all[tiddlers]

When I first read your examples, I immediately saw you have not defined the scope of this set and it would thus default to all[tiddlers]

You no doubt often start a filter with all[current], !is[system] etc... which is the first step to limit the size of the set of titles to be used by the filter.

I feel it is this concept which may need to be documented, rather than all the possible "invalid" cases one could write, like you adding 0 to every title.

This is quite true!
Reply all
Reply to author
Forward
0 new messages