[Gretl-devel] scalar function args and NAs

Sven Schreiber svetosch at gmx.net
Sun Jul 5 12:42:44 EDT 2015

Am 05.07.2015 um 17:08 schrieb Allin Cottrell:

> 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?

Well, NaN rather than NA, but since they're not differentiated in gretl:
In principle I could imagine that a function has the log-value of 
something as its input. Then the caller could write:


which could end up as thefunc(NA) for thisvalue <= 0. The question then 
is really who should bear the burden of sanity checking, the function or 
the caller.

Both is possible IMO.


More information about the Gretl-devel mailing list