Added is_func()

This commit is contained in:
Garth Minette 2021-04-06 16:57:26 -07:00
parent 21a8ec04ec
commit a05af703f9

View file

@ -185,6 +185,19 @@ function valid_range(x) =
: ( 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()
// Usage:
// bool = is_consistent(list, <pattern>);