Calling a subroutine with insufficient number of arguments no longer gives an error, but the missing arguments get the value
"UNDEFINED".
This is not documented, and not in the CHANGES file.
Now we can test for empty values, wouldn't is be better to change the missing argument values to empty instead?
Even better maybe: check for the correct number of arguments as in previous versions, but allow
Default to specify an empty value, e.g.
DefCall Foo Bar
Default Bar
IfEmpty Bar
...
EndIf
EndDefCall
Does that sound sensible? As long as it is not documented we can change it...
I'm not sure if the UNDEFINED thing should be there ... it might be a leftover from testing. But, what are we screwing around with this ... you can already set default values when you define a subroutine.
DefCall FunName2 arg1=123
print $arg1
EndDefCall
Perhaps the missing part is that you can't set arg1 to a null? Well, you can:
Set foo
Call FunName2 Foo
DefCall
which prints "UNDEFINED" ... hmm, I think the idea was that the function would check for the value "UNDEFINED" and act accordingly. However, if you change line 175 in func.py from "UNDEFINED" to "" it might work?? No, it doesn't ... but " " does. The problem is not in the function but in the other macro handlers ... I hate to start to work all though this for an exceptional case and introduce some other problems.