diff --git a/ClassDemo.Tanoa/classes/fnc_tell.sqf b/ClassDemo.Tanoa/classes/fnc_tell.sqf index a8b1eeb..8c5f638 100644 --- a/ClassDemo.Tanoa/classes/fnc_tell.sqf +++ b/ClassDemo.Tanoa/classes/fnc_tell.sqf @@ -21,4 +21,6 @@ _methods = [[["_method_list", "_msg"], _methods = [[["_x"], "not isNil ""_x"""] call fnc_lambdastr, _methods] call fnc_filter; _result = ([_instance] + _parameters) call (_methods select 0); -_result; // RETURN ////////////////////////////////////////////////////////// \ No newline at end of file +if (not isNil "_result") then { + _result; +}; // RETURN ////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ClassDemo.Tanoa/lambda/fnc_filter.sqf b/ClassDemo.Tanoa/lambda/fnc_filter.sqf index 253f369..7f8ca67 100644 --- a/ClassDemo.Tanoa/lambda/fnc_filter.sqf +++ b/ClassDemo.Tanoa/lambda/fnc_filter.sqf @@ -1,6 +1,6 @@ /////////////////////////////// fnc_filter ///////////////////////// 2016-10-21 -/* Filter an array by application of a predicate */ -////////////////////////////////////////////////////// +/* Filter an array by application of a predicate */ +///////////////////////////////////////////////////// private [ // "_fn", // Function [IN/A0/B0] // "_arr", // Array [IN/A1/B1] //// @@ -19,8 +19,14 @@ if ((count _this) == 3) then { _acc = []; for "_i" from 0 to ((count _arr) - 1) do { _elt = _arr select _i; - if (([_elt] + _extra_vars) call _fn) then { - _acc = _acc + [_elt]; + if (not isNil "_elt") then { + if (([_elt] + _extra_vars) call _fn) then { + _acc = _acc + [_elt]; + }; + } else { + if (([nil] + _extra_vars) call _fn) then { + _acc = _acc + [_elt]; + }; }; }; _acc; // RETURN ////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/classes/fnc_tell.sqf b/classes/fnc_tell.sqf index a8b1eeb..8c5f638 100644 --- a/classes/fnc_tell.sqf +++ b/classes/fnc_tell.sqf @@ -21,4 +21,6 @@ _methods = [[["_method_list", "_msg"], _methods = [[["_x"], "not isNil ""_x"""] call fnc_lambdastr, _methods] call fnc_filter; _result = ([_instance] + _parameters) call (_methods select 0); -_result; // RETURN ////////////////////////////////////////////////////////// \ No newline at end of file +if (not isNil "_result") then { + _result; +}; // RETURN ////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/lambda/fnc_filter.sqf b/lambda/fnc_filter.sqf index 253f369..7f8ca67 100644 --- a/lambda/fnc_filter.sqf +++ b/lambda/fnc_filter.sqf @@ -1,6 +1,6 @@ /////////////////////////////// fnc_filter ///////////////////////// 2016-10-21 -/* Filter an array by application of a predicate */ -////////////////////////////////////////////////////// +/* Filter an array by application of a predicate */ +///////////////////////////////////////////////////// private [ // "_fn", // Function [IN/A0/B0] // "_arr", // Array [IN/A1/B1] //// @@ -19,8 +19,14 @@ if ((count _this) == 3) then { _acc = []; for "_i" from 0 to ((count _arr) - 1) do { _elt = _arr select _i; - if (([_elt] + _extra_vars) call _fn) then { - _acc = _acc + [_elt]; + if (not isNil "_elt") then { + if (([_elt] + _extra_vars) call _fn) then { + _acc = _acc + [_elt]; + }; + } else { + if (([nil] + _extra_vars) call _fn) then { + _acc = _acc + [_elt]; + }; }; }; _acc; // RETURN ////////////////////////////////////////////////////////////// \ No newline at end of file