mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Added is_func()
This commit is contained in:
parent
21a8ec04ec
commit
a05af703f9
1 changed files with 13 additions and 0 deletions
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>);
|
||||||
|
|
Loading…
Reference in a new issue