From a05af703f9dee3ef7f2797c7345b2e4408d89b4c Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 6 Apr 2021 16:57:26 -0700 Subject: [PATCH] Added is_func() --- common.scad | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common.scad b/common.scad index ab24380..ba05fc8 100644 --- a/common.scad +++ b/common.scad @@ -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, );