Filters manipulate sets of titles in which no title may appear more than once.
<$list filter="[list[!!numbers]get[value]]">
</$list>
I think your proposal still could not handle arbitrary lists where the items (in this case numbers) are not predictable so it wouldn't be possible to make separate fields for them...
The "everything is a tiddler" philosophy doesn't always sit well with dominantly-appended lists (either list fields or the list widget itself)[1].
The dominant append approach is vital for UI construction, for obvious reasons,
but if the list widget had some kind of pragma attribute that controlled its behavior in this regard, then we could stop using the pre-restricted list field (which is also a problem) and use any other field(s) for lists where the content is under user (our) control. Something like...
<$list filter="blah" prefilter=none> ...
<$list filter="X12 X22 X32 X43" >
<$list filter="[<currentTiddler>!removeprefix[X1]] [<currentTiddler>!removeprefix[X2]] [<currentTiddler>!removeprefix[X3]] [<currentTiddler>!removeprefix[X4]]">
<$view field=title/><br/>
</$list></$list>
Filters manipulate sets of titles in which no title may appear more than once. Furthermore, they often need to append one such set to another.
This is done in such a way that, if a title would be duplicated, the earlier copy of that title is discarded. The titles being appended are dominant.
I think your proposal still could not handle arbitrary lists where the items (in this case numbers) are not predictable so it wouldn't be possible to make separate fields for them...I don't understand this, I'm afraid. Maybe you could explain a little more what you really need it to do? How to the numbers get in the list? I am just proposing that you have tiddlers 'val1' 'val2' etc. the names of which don't change and which each have a field called 'value' that you put the actual value in it. So your list is "the list containing the value field of each of these tiddlers, in this order" which can be arbitrary, I think....
<$list filter="X12 X22 X32 X43" >
codacoder wrote:The "everything is a tiddler" philosophy doesn't always sit well with dominantly-appended lists (either list fields or the list widget itself)[1].As far as I can tell, this is not a matter of the "everything is a tiddler philosophy" because the arguments are deliberately omitted in the filter. ...which, btw and IMO, is particularly inappropriate where the user explicitly puts those arguments in the filter.
The dominant append approach is vital for UI construction, for obvious reasons,Hm, I feel like I'm nit-picking semantics but does "dominent append approach" necessarily mean it also filters out stuff?
<$list filter="blah" prefilter=none> ...Yeah. If I recall, Jeremy said the listwidget is very complex and he is not in favour of introducing further complexity for it. I might have it mixed up with some other widget. Still, it is such a central widget so IMO it must either be very powerful or we need multiple niche widgets.
Thanks for your input, codacoder :-)
BTW, I'm surprised we (all of us) have not had this discussion before. At least not as far as I know.
<$list filter="1 2 3 +[get[number]]" >
<$view field="title"/>
</$list>
On 22 Aug 2017, at 16:41, codacoder...@outlook.com wrote:Yeah. If I recall, Jeremy said the listwidget is very complex and he is not in favour of introducing further complexity for it. I might have it mixed up with some other widget. Still, it is such a central widget so IMO it must either be very powerful or we need multiple niche widgets.
That does not surprise me at all. Maybe a new widget - $freelist ?
\define nthnum() [enlist<myList>nth[$(enum)$]]
<$vars myList="2 3 2 2" enumList="1 2 3 4 5">
<$list filter="[enlist<enumList>]" variable="enum">
<$wikify name=item mode=inline text='<$list filter="[enlist<myList>nth<enum>]"/>'>
<<item>>
</$wikify>
</$list>
</$vars>
All of the logic around uniquifying lists actually happens within the filter mechanism, ...
On 22 Aug 2017, at 17:12, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:Then why doesn't this work?
All of the logic around uniquifying lists actually happens within the filter mechanism, ...
Which I believe is also in use when managing data entered via a field called list - right?
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0154945b-5a8d-4cec-9203-fc2b810432e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BUT there are NO duplicate entries. Take a look at the code again. I enumerate a unique set of values (1 2 3 4 5) with enlist. There are no duplicates. THEN I call wikify on a sub-list. The results get crushed anyways.
Thanks,
Mark
On Tuesday, August 22, 2017 at 9:38:45 AM UTC-7, Jeremy Ruston wrote:Hi MarkOn 22 Aug 2017, at 17:12, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:Then why doesn't this work?The problem here is that the [enlist[]] filter operator reads the list using $tw.utils.parseStringArray(), which throws away duplicate entries:
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/896268d7-afbb-4007-b572-a31c9a678eff%40googlegroups.com.
How does it flatten it, when [enlist<myList>nth<enum>] is being called one at a time for each <enum> value and only generates one value? How can the *filter* be flattening it, when the filter should be generating exactly *one* item each time it is called? That is [enlist[1 2 3 4 5]nth[3] should only generate "3". So there is nothing to flatten. I even wrapped the render in a Wikify widget to try make sure there was no optimization cheating going on. It sure seems like flattening is occurring at the <$list>contents</$list> level rather than at the filter level, though it may be occurring at both levels.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f078bfb8-f9dd-43f5-89e4-a1e819b5f3d9%40googlegroups.com.
<$list filter="[enlist2[2 2 3 2]]" >
<$view field="title"/> -
</$list>
<$list filter="blah" prefilter=none> ...
- to avoid having to nest list widgets in list widgets
- - that may not even allow to retrieve the same aggregated results
Wouldn't a prefilter=none option turn off de-duplication for the entire filter?
On Tuesday, August 22, 2017 at 3:05:13 PM UTC-5, Mark S. wrote:Wouldn't a prefilter=none option turn off de-duplication for the entire filter?
Likely. Why I also mentioned some kind of pragma approach or even a new kind of list widget. But without knowing at what level of granularity it's best to address/apply the solution, it's hard to say what might be the better approach (from a core perspective, I mean).
Jeremy, before posting a wish on github,.. attr? filterop? new freelist widget? something else? does any of this grab you?
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/45312428-eae3-4ae8-9bb0-5ed26a45c393%40googlegroups.com.
It would be useful to find the earlier discussions. ...
Anyway, the macro call for the extended rpn macro would be something like <<rpnx "2 3 4 4 4 4 4 4 +">> or something similar. So, the numbers are actually explicitly stated by the user.<:-)