On Wed, 13 May 2015, Sven Schreiber wrote:
Am 13.05.2015 um 09:41 schrieb Sven Schreiber:
> Hi,
>
> a new thingy:
>
> <hansl>
> function void scheck (int a, string *s)
> printf "%s\n", s
> end function
>
> string hey = "ho"
> scheck(2, &hey)
> </hansl>
And I just discovered that not using the pointer form seems to work with a
null default value:
<hansl>
function void scheck (string s[null])
if isnull(s)
print "null"
else
print s
endif
end function
scheck()
</hansl>
I'm mentioning this because according to the docs under the
heading "Function parameters: optional refinements" it says: "For
optional pointer and list arguments (see section 13.4), the
special default value null." So this case isn't covered by the
description.
Right enough; it should be.
OTOH if I try this null value with an integer argument (and no
pointer), it indeed does _not_ work.
Maybe we're being unduly influenced by the fact that in the C world
a string is already a pointer-y thing.
Allin