From 777facc9a25072abdf9da7520f891f27fc7d69a0 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Thu, 21 May 2020 16:49:06 -0400 Subject: [PATCH] Tweaked one_defined to give a better message when nothing was defined --- common.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.scad b/common.scad index d94208f..31d5811 100644 --- a/common.scad +++ b/common.scad @@ -177,7 +177,7 @@ function one_defined(vars, names, required=true) = let ( ok = num_defined(vars)==1 || (!required && num_defined(vars)==0) ) - assert(ok,str("Must define ",required?"exactly":"at most"," one of ",[for(i=[0:len(vars)]) if (is_def(vars[i])) names[i]])) + assert(ok,str("Must define ",required?"exactly":"at most"," one of ",num_defined(vars)==0?names:[for(i=[0:len(vars)]) if (is_def(vars[i])) names[i]])) first_defined(vars);