Hi Stephan This is fine in most cases. But what if your field is called "each" or > "next"? Those names happen to also be filter functions. So there is no way > yet to compare those field's values. >
This definitely needs to be fixed. 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]] Best wishes Jeremy. > 1. Stay compatible with all filtering done in any TW5 out there > 2. Are free in the usage of fieldnames as they won't clash with > operators (filters) introduced in the future > 3. Get a nice visual clue that the operator is in fact a fieldname > > I already implemented it in > https://github.com/Skeeve/TiddlyWiki5/tree/field_enhancement so you can > check it. > > > -- > 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. > -- Jeremy Ruston mailto:[email protected] -- 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.
