What is an optional argument?
For some operators, there may be optional arguments which, if supplied, allow the operator's output to be given differently. In the main documentation listing of operators, square brackets indicate optional argument(s). For instance, with the indented(N[,"item"]) operator it takes two arguments the second of which is optional. Thus, using intended(N) works with only a single argument (N) supplied but indented(N[,item]) can be coded with two arguments (N and item)to give a more nuanced output.
In almost all cases, the optional arguments are supplied last, after any mandatory arguments, but be aware there are a few where the optional argument comes first, e.g. values([group,]attribute).
Arguments may be optional because:
- A default value is assumed unless a (non-default) value is passed, thus saving having to 'state the obvious' by passing in a value that is already presumed.
- The optional argument signals the function to alter its default behaviour, e.g. giving a different form of returned output.