[Gretl-devel] scalar function args and NAs

Allin Cottrell cottrell at wfu.edu
Sun Jul 5 11:08:36 EDT 2015

A question has come up as I've thought about user-function 
arguments (see also
http://lists.wfu.edu/pipermail/gretl-devel/2015-July/005850.html )

Given a scalar parameter, what do we want to do if the caller supplies 
NA as an argument? What difference, if any, should it make if the 
parameter is marked as "bool" or "int" rather than plain "scalar"?

The situation prior to my changes of the last couple of days was that
NA was always accepted. But along with fixing the bounds checking for 
scalar arguments, I banned NA for bool and int parameters. I've now 
had second thoughts (maybe this would break some existing scripts?) 
and have reverted to the status quo ante.

But maybe this is something we want to think about. Are there real 
use-cases where a function writer would want to accept NA for a bool 
or int argument? Or would it be more convenient for the writer not to 
have to bother with checking for NAs, in the knowledge that they would 
be ruled out by gretl?


More information about the Gretl-devel mailing list