mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-07-31 23:00:11 +02:00
Added asserts to select()
This commit is contained in:
@@ -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]] :
|
||||
|
@@ -8,7 +8,7 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,226];
|
||||
BOSL_VERSION = [2,0,227];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
Reference in New Issue
Block a user