Pragma function and negation

Hi,
Is it possible to do something when a function is called with the ! negation parameter ?

Like that :

\function my.func()
[…]
\end

{{{ [!my.func[]] }}}
1 Like

Great question.

I notice that ! is not listed against the function operator so I guess that implies the same is true for the my.fn syntax.

Is !my.fn allowed as a definition?

\function !my.fn() ...

I haven’t tried it.

Thanks for your answer.

I tried to define !my.fn, but unfortunately it doesn’t seem to work.

It does not make sense, to me, to define a function as a negative, a function is a filter, and by its nature may be a selection constructor or a selection modifier.

  • Also I would not call this “pragma negation” but only “function negation”.

However it is only when it is referenced, in context, that that we may use it as provided or negate it.

  • I suspect something needs to be done to permit “functions” or “custom filter operators” to operate fully with the negation.

However from inside a filter there are other ways to use a function “in the negative”.

[subfilter<all-words>!subfilter<common-english-verbs>!subfilter{English Stop words}!subfilter<common-adjectives-English>sort[]]
  • In the above <common-English-verbs> is a function and I use the !subfilter<common-English-verbs> to remove “common English verbs” from the list.
1 Like