Suppose that we define UpValues for different symbols
isSpecialFunction[N1]^=True isSpecialFunction[N2]^=True isSpecialFunction[N3]^=True
I would like to make the following definition
such that every time I write e.g.
func Mathematica substitutes it with
func[t,x] only if
func_?isSpecialFunction:= func[t,x] is not a good definition because I get the error
SetDelayed: "func_?isSpecialFunction does not contain a symbol to attach a rule to. What is the proper procedure to give the aforementioned definition for symbols with UpValues defined in this way?
Please, keep in mind that I want to use the fact that these symbols have UpValues. That's because I am using a package (
xCoba), which defines ScalarFunctions with these UpValues and I want to substitute all the ScalarFunctions that appear as