Fix for no_module() example.

This commit is contained in:
Garth Minette 2021-01-28 17:26:46 -08:00
parent 12cc40a56f
commit 762eb88d3d
2 changed files with 6 additions and 5 deletions

View file

@ -552,14 +552,15 @@ function segs(r) =
// module foo() { // module foo() {
// no_children($children); // no_children($children);
// } // }
// foo();
module no_children(count) { module no_children(count) {
assert($children==0, "Module no_children() does not support child modules"); assert($children==0, "Module no_children() does not support child modules");
assert(count==0, str("Module ",parent_module(1),"() does not support child modules")); echo(parents=$parent_modules);
if ($parent_modules>0) {
assert(count==0, str("Module ",parent_module(1),"() does not support child modules"));
}
} }
// Function: no_function() // Function: no_function()
// Usage: // Usage:
// dummy = no_function(name) // dummy = no_function(name)
@ -577,7 +578,7 @@ function no_function(name) =
// Description: // Description:
// Asserts that the called module exists only as a function. // Asserts that the called module exists only as a function.
// Example: // Example:
// no_module(); // function foo() = no_module();
module no_module() { module no_module() {
assert(false, str("You called ",parent_module(1),"() as a module but it is available only as a function")); assert(false, str("You called ",parent_module(1),"() as a module but it is available only as a function"));
} }

View file

@ -6,7 +6,7 @@
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,547]; BOSL_VERSION = [2,0,548];
// Section: BOSL Library Version Functions // Section: BOSL Library Version Functions