There are many functions in Macaulay 2 that do various things. You can get a brief indication of what a function does by typing its name.
i1 : sin |
In this case, we see that the function sin takes a single argument x. We apply a function to its argument by typing them in adjacent positions. It is possible but not necessary to place parentheses around the argument.
i2 : sin 1.2 |
i3 : sin(1.2) |
i4 : sin(1.0+0.2) |
In parsing the operator ^ takes precedence over adjacency, so the function is applied after the power is computed in the following code. This may not be what you expect.
i5 : print(10 + 1)^2 |
Some functions take more than one argument, and the arguments are separated by a comma, and then parentheses are needed.
i6 : append |
i7 : append({a,b,c},d) |
Some functions take a variable number of arguments.
i8 : join |
i9 : join({a,b},{c,d},{e,f},{g,h,i}) |
Functions, like anything else, can be assigned to variables. You may do this to provide handy private abbreviations.
i10 : ap = append; |
i11 : ap({a,b,c},d) |