On Sunday, January 12, 2014 2:57:42 PM UTC-5, Jeremy Ruston wrote: ...
> So here is my small proposal for an enhancement: If we want to compare a >> field, we put a colon after the fieldname. So filtering for the "next" >> field will now be possible because we write "next:[value]". >> >> This proposal works without changing anything in tiddlywiki, except for >> one small change in field.js. In field.js we simply need to replace a >> trailing ":" if there is one. Doing it this way we >> > > The fact that a change is small in terms of the lines of code affected has > little bearing on whether it's a desirable change. We're optimising TW5 for > the best end user experience we can, and that should remain the dominant > consideration when we think about changes. > > Anyhow, I quite like this suggestion, but wonder if we can go further. > > We could enhance the syntax for filters such that an operator can have an > optional suffix, separated by a colon: operator:suffix[parameter] > > For example: > > field:next[value] > > Here, the filter is "field" with the suffix "next" identifying the field > to be compared. > > The suffix would be optional. The system would fall back to trying to > treat unknown operators as suffixes for the "field" operator. > > This would be quite handy for some of the other operators. For example, > the sameday and eachday operators are hardcoded to use the "modified" > field; instead we could support: > > sameday:created[[20131231]] > ... -- > Jeremy Ruston > > This seems like an effective way to implement "IF ... THEN ... ELSE" capabilities within a List filter, which I think could be very useful. It would be especially nice to be able to compare each of the result lines and Rank (perhaps simply by sorting) them in various ways. I don't know enough about Filters and Operators yet to know if this is a valid approach, but I can certainly see cases in which I would make extensive use of it. That being said, Am I simply still unaware of other ways of post-processing List results that would be preferable? I'm asking only because I'm preparing to design some of my Tiddlers in the hopes that some of them will also survive "the next 25 years" "-) and I'd like to make sure I starting moving in the right directions. Regards, Hans -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywikidev. For more options, visit https://groups.google.com/groups/opt_out.
