Hi Tobias In the case of the putbefore[], putafter[] and replace[] operators, the operand is used to specify the marker item -- this necessitated that items be moved from the end of the list to the new position.
Where items are being prepended, appended or removed from the list, there is no need for a marker, and the operand becomes available for specifying the items involved. One advantage is that items can be picked as a range from an array, which may be referenced rather than directly specified (as in, append the last three days-of-the-week to the list.) Yes, this introduces inconsistencies in the syntax, but I believe the additional functionality justifies this (if there's a marker involved, items come from the end of the list -- if not, items come from the operand.) There are often different ways of writing a filter expression to achieve the same result -- to my mind, the additional code involved in adding a few extra filter operators is justified, if this makes the writing of filter expressions easier for a user (after all, a user doesn't have to use them all, but can stick to their favoured method.) I'm not sure that I understand what you mean by the expression 'assuming that individual titles are simple words'. regards On Tuesday, 27 October 2015 11:31:19 UTC+2, Tobias Beer wrote: > > Hi Metabele, > > >> I have updated the append[] and prepend[] operators to understand a >> prefix and suffix. The prefix designates the number of items to take from >> the operator parameter (to append or prepend to the list) -- with no >> prefix, these are taken from the head and with a prefix from the tail. >> > > It appears you are assuming that individual titles are simple words´. > I don't think that works as planned as a filter may not have a > sub-filter-list. > > Append and prepend should work exactly as any of your *put-foo* filters, > only just that the marker needs no specifying. > > Also, isn't the generic way to append or prepend simply doing... > > filter="prepended appended" > > ...whereas *appended *gets appended to the list on which there is > *prepended* > or *prepended* gets prepended to the list on which there is *appended*. > > So, what's the use-case for these two > that the general filter syntax can't do out of the box? > > In other words, to me it should be... > > filter = [list[Days of the Week]] Yesterday Today Tomorrow +[prepend:3[]]" > > ...if we are to stay consistent how to select and act on a number of > list-items. > So, it selects the last three in the list and puts them first in the > specified order. > > Assuming the list Days of the Week held one item, namely " > *[[Party Friday]]*", the resulting list would be... > > Yesterday Today Tomorrow [[Party Friday]] > > ...in its stringified version. > > Best wishes, > > — tb > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/11ef366c-c82a-445a-851b-102c43af5dd1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

