How to add "comments" to filter expressions

I personally don’t see the need to add a “noop” operator to TiddlyWiki, since with the ability to define your own functions (linked for anyone unaware), you could just do this (at the top of a tiddler tagged $:/tags/Global):

\function .noop() [all[]]

(For those who don’t know, the all[] operator with an empty parameter simply returns a copy of the input. You could also use [addprefix[]] or some other method of performing no change to the inputs. Extraneous parameters are ignored, but if you like, you could add a dummy parameter to the function.)

But maybe :noop filter run prefix with a nice unused shortcut such as # could be a nice alternative to using -.

{{{
  #" (Explanation of the entire filter expression)"
  [all[tiddlers+shadows]tag[spam].noop[##get everything tagged "spam"###]]
  #" Next we use :filter to filter out those tagging more than 3 items "
  :filter[tags[]count[]compare:integer:gt[3]]
  #"...(other steps)..."
}}}
3 Likes