diff --git a/arrays.scad b/arrays.scad index acad4e0..6f8c2d1 100644 --- a/arrays.scad +++ b/arrays.scad @@ -227,10 +227,14 @@ function list_set(list=[],indices,values,dflt=0,minlen=0) = // Arguments: // list = The list to remove items from. // elements = The list of indexes of items to remove. +// Example: +// list_insert([3,6,9,12],1); // Returns [3,9,12] +// list_insert([3,6,9,12],[1,3]); // Returns [3,9] function list_remove(list, elements) = !is_list(elements) ? list_remove(list,[elements]) : len(elements)==0 ? list : - let( sortind = list_increasing(elements) ? list_range(len(elements)) : sortidx(elements), + let( + sortind = list_increasing(elements) ? list_range(len(elements)) : sortidx(elements), lastind = elements[select(sortind,-1)] ) assert(lastind