From 8cd0168f27e404beba084be8e2f0e2c18ad0d22b Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Wed, 25 Mar 2020 15:05:27 -0700 Subject: [PATCH] Added asserts to select() --- arrays.scad | 3 +++ version.scad | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arrays.scad b/arrays.scad index 1cb0947..3fd8b63 100644 --- a/arrays.scad +++ b/arrays.scad @@ -47,8 +47,11 @@ function select(list, start, end=undef) = end==undef? ( is_num(start)? let(s=(start%l+l)%l) list[s] : + assert(is_list(start) || is_range(start), "Invalid start parameter") [for (i=start) list[(i%l+l)%l]] ) : ( + assert(is_num(start), "Invalid start parameter.") + assert(is_num(end), "Invalid end parameter.") let(s=(start%l+l)%l, e=(end%l+l)%l) (s<=e)? [for (i = [s:1:e]) list[i]] : diff --git a/version.scad b/version.scad index 6e58e8e..14b3956 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,226]; +BOSL_VERSION = [2,0,227]; // Section: BOSL Library Version Functions