On Thu, 13 Apr 2017, Sven Schreiber wrote:
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.
True, and I was aware of that. I decided to postpone discussion of the
point until after the 2017a release. It's awkward, and I'm not sure
exactly what to do about it. Maybe at this stage, with backward
compatibility in mind, we just have to document it plainly and admit
that it's an inconsistency.
(BTW and completely different: $lang isn't syntax colored.)
Now fixed in git.
Allin