When using the MathLink C interface, if we want to get arguments manually, we need to put the following in the template file:
:ArgumentTypes: { Manual }
:ReturnType: Manual
I accidentally used
:ArgumentTypes: Manual
:ReturnType: Manual
instead.
mprep does ‘compile’ this template file without errors, and generates valid C code for it, but it doesn’t have the same behaviour as the standard :ArgumentTypes: {Manual} specification.
Diffing the outputs shows only one difference: the f_nargs member of the “func” struct is set to -1 for this function with :ArgumentTypes: Manual, while with {Manual} it is 0.
Question: Is :ArgumentTypes: Manual meaningful, and if yes, what is its use?
:ArgumentTypes: Manual is meaningful and is intended for use with one argument functions as follows:
:Begin:
:Function: bar
:Pattern: Bar[i_Integer]
:Arguments: i
:ArgumentTypes: Manual
:ReturnType: Manual
:End:
Mprep (the program that parses template files) allows the braces to be optional in the case of Manual argument types. You cannot however specify arbitrary argument types in
in this form. Manual is the only type allowed to not have the braces wrapper.
Thank you for the explanation. I think the reason it gave me strange results when I ommitted the braces was that I have a two-argument function, like this: