From 762eb88d3d92a8a24cb9e8dfe6bc8c3587c67f79 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Thu, 28 Jan 2021 17:26:46 -0800 Subject: [PATCH] Fix for no_module() example. --- common.scad | 9 +++++---- version.scad | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common.scad b/common.scad index d47f3a3..b525881 100644 --- a/common.scad +++ b/common.scad @@ -552,14 +552,15 @@ function segs(r) = // module foo() { // no_children($children); // } -// foo(); module no_children(count) { 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() // Usage: // dummy = no_function(name) @@ -577,7 +578,7 @@ function no_function(name) = // Description: // Asserts that the called module exists only as a function. // Example: -// no_module(); +// function foo() = no_module(); module no_module() { assert(false, str("You called ",parent_module(1),"() as a module but it is available only as a function")); } diff --git a/version.scad b/version.scad index 3c31e41..4624dd3 100644 --- a/version.scad +++ b/version.scad @@ -6,7 +6,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,547]; +BOSL_VERSION = [2,0,548]; // Section: BOSL Library Version Functions