mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-02-19 10:09:39 +00:00
commit
cb11ac558a
1 changed files with 1 additions and 0 deletions
|
@ -798,6 +798,7 @@ function unique(arr) =
|
||||||
// arr = The list to analyze.
|
// arr = The list to analyze.
|
||||||
function unique_count(arr) =
|
function unique_count(arr) =
|
||||||
assert(is_list(arr) || is_string(arr))
|
assert(is_list(arr) || is_string(arr))
|
||||||
|
arr == [] ? [[],[]] :
|
||||||
let( arr=sort(arr) )
|
let( arr=sort(arr) )
|
||||||
let(ind = [0,for(i=[1:1:len(arr)-1]) if (arr[i]!=arr[i-1]) i])
|
let(ind = [0,for(i=[1:1:len(arr)-1]) if (arr[i]!=arr[i-1]) i])
|
||||||
[select(arr,ind),
|
[select(arr,ind),
|
||||||
|
|
Loading…
Reference in a new issue