Caution: the default value for an argument only applies when the caller
does not supply that argument. It does not apply when the caller
supplies "undef" as an argument. There is no simple way to pass through
the fact that an argument is omitted.
Thus, for instance:
module foo(val = 0) {
echo(val);
}
foo(); // ECHO: 0
module bar(val) {
foo(val); // just passing it through
}
bar(); // ECHO: undef
(Yes, of course bar() could impose its own default. But if the intent
is that bar's default is the same as foo's, you would rather not have to
duplicate it.)
On 2/9/2026 6:16 AM, nop head wrote:
Also "check the parameter range for builtin modules" is an option in
preferences, so I would expect any garbage ones to be rejected when
that option is set.
Alas, it's not universally respected.