Am 07.04.2017 um 21:49 schrieb Allin Cottrell:
If you (as a function writer) choose to give a "null"
default for any of
these parameter types, you need to be ready to use exists() to check
whether the caller actually gave you anything.
OK, except (reminder to self and perhaps to some others as well) if you
use the gretl list type. (Which is implicitly clear in your mention of
"these types", because you only spoke of arrays, bundles, series, not
lists.)
This example:
<hansl>
nulldata 10
function void cc(list in[null])
if !nelem(in)
if exists(in)
print "exists but empty"
endif
endif
end function
cc()
</hansl>
does print out "exists but empty" for me.
(BTW and completely different: $lang isn't syntax colored.)
thanks,
sven