I would like to define patterns that match with variable argument number functions, like patterns "__" and "___" in wolfram's mathematica:
f[a_,b___,c_] match with
f[r,s]
f[r,q,s]
f[r,q,w,s]
Sadly, gnu maxima has no way to instruct to its simplifier this kind of rules
Best Regards
M
Anonymous
2010-05-25
I am not familiar with Mathematica (it's been 15 years...), but Maxima does allow you to define a function that takes a variable number of arguments, viz.
f(x,[y]) := ....
then
f(a) --> x=a, y=[]
f(a,b) --> x=a,y=[b]
f(a,b,c) --> x=a,y=[b,c], etc.