mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-09 09:46:49 +02:00
Added asserts to select()
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user