use <./base.scad>; ERROR_BEGIN=""; ERROR_END=""; module precondition(test,error,m=undef) { if(!test) { echo(str(ERROR_BEGIN,default(m,parent_module(1)),": ",error,ERROR_END)); assert(false); } else children(); } function precondition(test,value,error)=test ? value : echo(str(ERROR_BEGIN,error,ERROR_END)) assert(false); module check_defined(val,error,m=undef) { precondition(val != undef,error) children(); } function check_defined(value,error)=precondition(value != undef,error); module check_parent(parent,statement,error,m=undef) { precondition(parent_module(3) == parent,str(statement,"(): ",error)) children(); }