Thanks @etardiff I am getting lists via transclusion [{!!field-list}] and literals background created text temp but trying to remove items listed via a function seems not to be working.
In this case I can revert to the transclusion but it would be nice if remove<title.list> was working, so I can use a logical name, rather than needing to remember the tiddler/fieldname.
I am tempted to find a clear and simple set of rules to combine or remove items from one of more named lists of titles (or strings). If I cant get it I would consider custom operators OR new javascript operators.
I’m not sure why… it seemed to work when I tested the above code on TW-com. But if you’ve got a package of tiddlers you’re working with, I’d be happy to take another look.
Alternately, you could replace +[remove...] with -[enlist...] or use the fields:exclude suffix:
IMO, the absolute simplest way to do it is by using an additional filter run:
[enlist<my-var>] to add items (or simply [<my-var1>] [<my-var2>] +[join[ ]] if you want a title list as your output, as I did in \function standard.fields above)
-[enlist<my-var>] to remove them
But if you need to do it in a single filter run, we do already have prepend and append (which don’t deduplicate) and remove. I don’t think there’s a particular gap here.
Thanks, I see what you are saying, what you propose works, I suppose I did not understand why what I did was not working, but I do see why what you suggested does work.
the fields:include[] and fields:exclude[] were unfamiliar to me, and they do an existence test
A bit more research on my part to get a fuller picture.
by the way the reason I placed the literal list in a tiddler/field eg; {CoreFields!!field-list} was so new fieldnames could be added programmatically, otherwise we need to edit the function to add a fieldname.
The custom.fields supposed to be any field not in the core.fields or standard.fields as listed here https://tiddlywiki.com/#TiddlerFields which is different to your lists.
This seems to me that the standard and core field lists should be part of the core, and available to the designer, just like system tags that do not yet exist in the wiki but could. Part of why I am experimenting so I can put in a GitHub issue. The idea being once new core fields are added, they will be added to this list.
There are no standard fields, because they would be overwritten by users anyway, since every usecase is different. I for one would add all fields that I do want to exclude in an exclude-variable and not added to standard fields. So that would duplicate code, which in turn is confusing for other users
The only field necessary for a tiddler is the title. So is this the standard-fields variable.
A client server configuration has different fields than a single-file version
MultiWikiServer is different too.
tw-com defines a lot of fields too. Are they standard. IMO no they are use-case specific.
Just my thoughts.
IMO your last 2 lines of code snippets would be useful as an example somewhere in the filters-docs. May be somewhere linked to the fields-operator. Including the function definition, so users can play with it.