mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-01 23:40:17 +02:00
Added is_func()
This commit is contained in:
13
common.scad
13
common.scad
@@ -185,6 +185,19 @@ function valid_range(x) =
|
|||||||
: ( x[1]<0 && x[0]>=x[2] ) );
|
: ( x[1]<0 && x[0]>=x[2] ) );
|
||||||
|
|
||||||
|
|
||||||
|
// Function: is_func()
|
||||||
|
// Usage:
|
||||||
|
// bool = is_func(x);
|
||||||
|
// Description:
|
||||||
|
// Returns true if OpenSCAD supports function literals, and the given item is one.
|
||||||
|
// Arguments:
|
||||||
|
// x = The value to check against.
|
||||||
|
// Example:
|
||||||
|
// f = function (a) a==2;
|
||||||
|
// bool = is_func(f); // Returns: true
|
||||||
|
function is_func(x) = version_num()>20210000 && is_function(x);
|
||||||
|
|
||||||
|
|
||||||
// Function: is_consistent()
|
// Function: is_consistent()
|
||||||
// Usage:
|
// Usage:
|
||||||
// bool = is_consistent(list, <pattern>);
|
// bool = is_consistent(list, <pattern>);
|
||||||
|
Reference in New Issue
Block a user