NotListQ
[expr]True
if expr is not a list. This function is primarily used in function patterns for specifying type of a parameter. Consider this definition for taking the deriviate Sin
of a function:
MyD[Sin[f_],x_?NotListQ] := D[f,x]*Cos[f]
=
We use “MyD” above to distinguish it from the Builtin D
. Now let's try it:
MyD[Sin[2 x], x]
And compare it with the Builtin deriviative function D
:
D[Sin[2 x], x]
Note however the pattern only matches if the x parameter is not a list:
MyD[{Sin[2], Sin[4]}, {1, 2}]