mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-07 17:36:57 +02:00
Merge pull request #452 from revarbat/revarbat_dev
Alias homogenous() for homogeneous().
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// Function: is_homogeneous()
|
// Function: is_homogeneous()
|
||||||
|
// Alias: is_homogenous()
|
||||||
// Usage:
|
// Usage:
|
||||||
// bool = is_homogeneous(list,depth);
|
// bool = is_homogeneous(list,depth);
|
||||||
// Topics: List Handling, Type Checking
|
// Topics: List Handling, Type Checking
|
||||||
@@ -38,6 +39,8 @@ function is_homogeneous(l, depth=10) =
|
|||||||
!is_list(l) || l==[] ? false :
|
!is_list(l) || l==[] ? false :
|
||||||
let( l0=l[0] )
|
let( l0=l[0] )
|
||||||
[] == [for(i=[1:len(l)-1]) if( ! _same_type(l[i],l0, depth+1) ) 0 ];
|
[] == [for(i=[1:len(l)-1]) if( ! _same_type(l[i],l0, depth+1) ) 0 ];
|
||||||
|
|
||||||
|
function is_homogenous(l, depth=10) = is_homogeneous(l, depth);
|
||||||
|
|
||||||
function _same_type(a,b, depth) =
|
function _same_type(a,b, depth) =
|
||||||
(depth==0) ||
|
(depth==0) ||
|
||||||
|
Reference in New Issue
Block a user