Currently, if I define a function like:
..
function func ( series a, scalar b[1:2:1], bool c[1], list d[null])
..
I'm supposed to be able to call the above-mentioned function with something
like:
..
a = uniform()
a = func(a)
..
and Gretl is supposed to assign the default values to the scalar b and the
boolean c, and at the same time, gretl should tolerate the absence of the
list d as parameter. The logic is "I omitted the parameters because I know
what I'm doing".
Currently, Gretl complains about the lack of the parameters
func: not enough arguments
Command has insufficient arguments
where the error is due only to the absence of the list.
I know that the [null] identifier in the definition of the function means
that the list may be empty (not missing) but actually the script works fine
even without the [null] tag when any empty list is passed.
So, it might be thought to tolerate missing parameters if the absence
doesn't compromise the usability of the function itself. Obviously some
convention should be introduced on the subject. The same idea could be valid
for series and matrix as well.
I know this feature-request is not a top priority, but I just wanted to
point out something that could be useful to extend the gretl scripting
capabilities.
Cheers,
Stefano