the underscore makes it a symbolic variable, not one with value
unbound in the lambda sense
unbound in the lambda sense
⇒ underscores must come at the end.
So when you call a function on some argument or list of arguments, the interpreter looks up all the function definitions and finds one with a pattern that matches.
Double[x_] := 2 * x
Will work for Double[3] but not for Double[3, 2], the latter doesn't match any patterns, and the interpreter doesn't know what to do with it. You would have to define another function with the same name to handle other patterns, like overloading in C++You can further constrain the pattern to types like this:
Double[x_Integer] := 2 * x
And now the pattern only matches integers.
More in the manual, "Patterns"[0] and "More about Patterns"[1][0] https://www.wolfram.com/language/elementary-introduction/2nd...
[1] https://www.wolfram.com/language/elementary-introduction/2nd...