How do I use the ::usage
tag to allow the Mathematica v9 front end to know that there are multiple ways to call an overloaded function (a function that can have different number of arguments?
For example, if I sequentially run the two commands
myfunc::usage = "foo[x,y,z] will combine x, y and z for you.";
myfunc::usage = "foo[x,y,z,w] will be even better.";
The second line has overwritten the first and the front end doesn't know about both cases. A built-in example of what I'm talking about is Table
which the front-end recognizes as having many different templates.
Answer
As of Mathematica 9, multiple autocomplete templates are supported and the different templates are delimited by newlines. So for your example, you'll need to define them as:
myfunc::usage = "foo[x,y,z] will combine x, y and z for you.
foo[x,y,z,w] will be even better.";
Comments
Post a Comment