Am 18.11.2016 um 19:08 schrieb Allin Cottrell:
On Fri, 18 Nov 2016, Sven Schreiber wrote:
> after which exists(s)==1 and even more paradoxically
isnull(s)==0.
Yeah, but remember that isnull() is deprecated (partly for this sort
of
reason).
Yes, and it's OK that it simply and always returns the complement to
exists(). However, it's still described in section 13.4 of the guide (in
the context of optional pointer arguments).
Which fix? Personally I'd rather get rid of 'string s =
null',
In principle that would be fine with me (although the status quo is
according to the spec in ch.14).
OTOH when you say that one can always do 'string s=""', then one could
also argue that one can do "strings ss=defarray()" or "strings
ss=array(0)", and similarly for the other array types (matrices,
bundles). So I'd tend to think that we should ditch the "null" business
either everywhere or nowhere.
that's too disruptive we could treat strings like lists in this
regard:
in case of no arg given for a string param with "null" default,
manufacture an empty string.
Let's compare the situation to scalar function arguments: There "null"
is not allowed (let's leave the pointer stuff aside for now) because you
can assign some default value and that's enough.
Why not do the same for string arguments, actually? Examples:
string s[""] # empty string by default
string s["heyho"] # or --new feature-- some arbitrary literal string
thanks,
sven