The julia docstring convention for a function
f(x,y) where the second argument is optional, is:
1 is the default value of the argument. This coincides nicely with the method definition. What does one do, however, if
x is the optional argument? The choice
seems odd, as we don’t place non-optional arguments after optional ones. The alternative to this is to use square brackets, and express this as
This is what
zeros does, for example:
However, the docstring convention also states that brackets are to be used in cases where the optional argument does not have a default value, but it does have one in this case. I wonder if the convention is to use brackets in this case anyway?