Is it possible to define a function with a custom warning message ?
For example,
In[1]= f[x_,y_]:=x-y (* with a warning message when the result is negative*)
In[2]= f[5,3]
Out[2]= 2
In[3]= f[3,5]
Out[3]= -2
Negative : the result is negative
Also I don't want to see duplicate warning messages. For example,
In[4]= {f[3,7],f[4,6],f[5,7]}
Out[3]= {-4,-2,-2}
Negative : the result is negative
It produced three negative numbers, but it produced a single warning message.