Ah, now I see why @CodaCoder mentioned it being a constructor in the zeroth position. Though I think this could just as easily mess things up in the opposite way. For example:
[noop[This run does so and so (explanation of the run)]tag[eggs]!has[spam]]
If you design noop
to be a constructor outputting nothing if given as the start of a filter run, then inserting it at the beginning of a filter run changes the outcome of the filter run (and therefore is not a noop).
You might say that in such cases you should separate it into its own run:
[noop[This run does so and so (explanation of the run)]] [tag[eggs]!has[spam]]
I might just as easily say that if you’re using a custom .noop
in its own run, you should make it a +
run or add it to the end inside the previous run ([[HelloThere].noop[comment]]
). (Or, if provided at some point, a :noop
prefix.)
I’d be surprised if you could even put the necessary logic into a JavaScript-defined filter operator without significant changes to how filter runs work. I would’ve assumed that, even defined in JavaScript, the filter operators don’t know their positions in the run, and are only given a list of inputs to manipulate. But someone who knows the code could tell us for sure. Are there any other filter operators that behave differently depending on whether they are the first operator in the run?