discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

include BOSL2 and GUI goes blank!!

JB
Jordan Brown
Mon, Feb 9, 2026 9:32 PM

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.)

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.)
JB
Jordan Brown
Mon, Feb 9, 2026 9:33 PM

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.

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.