In order to create a function that would add any number of arguments, I tried
and the output was
f[1,2,3] instead of 6. I thought this had worked for me before... what should I do instead?
That's exactly what I ended up trying. Before, I kept trying to use conditions that weren't necessary; thanks for your help.
MyPlus[x___Integer] := Plus[x]
MyPlus[1, 2, 3]
The ClearAll is not necessary, I'm just being careful ;)
How would I set conditions for it to be only for integers? I tried IntegerQ, but I'm unsure of the format. I tried using IntegerQ, but I'm unsure how to format it. Thank you for answering my beginner's question. I appreciate it.
In:= f = Plus
In:= f[1, 2, 3]