mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Added asserts to select()
This commit is contained in:
parent
a102663b1a
commit
8cd0168f27
2 changed files with 4 additions and 1 deletions
|
@ -47,8 +47,11 @@ function select(list, start, end=undef) =
|
||||||
end==undef? (
|
end==undef? (
|
||||||
is_num(start)?
|
is_num(start)?
|
||||||
let(s=(start%l+l)%l) list[s] :
|
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]]
|
[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)
|
let(s=(start%l+l)%l, e=(end%l+l)%l)
|
||||||
(s<=e)?
|
(s<=e)?
|
||||||
[for (i = [s:1:e]) list[i]] :
|
[for (i = [s:1:e]) list[i]] :
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,226];
|
BOSL_VERSION = [2,0,227];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue