Closed jasraj closed 3 years ago
.ns.getFunctionArguments
Now supports types 101, 102, 103 and 104h:
q).ns.getFunctionArguments (::) ,`x q).ns.getFunctionArguments (+) `x`y q).ns.getFunctionArguments (') `x`y q).ns.getFunctionArguments {[x;y;z] z }[;1;] `x`z
.ns.protectedExecute
Now supports passing functions by value and works with the additional types supported by .ns.getFunctionArguments:
q).ns.protectedExecute[(::); 1] 1 q).ns.protectedExecute[(+); 1 2] 3 q).ns.protectedExecute[('); (neg; 1 2)] -1 2 q).ns.protectedExecute[{[x;y;z] z }[;1;]; 0 -1] -1
Error example:
q).ns.protectedExecute[(+); (1;`a)] isError | `PROT_EXEC_FAILED backtrace| () errorMsg | "type"
Both now throw NotAFunctionException if the value passed is not a function or the reference does not refer to a function:
NotAFunctionException
/ Protected execute the protected execute! q).ns.protectedExecute[`.ns.protectedExecute; (1; 1)]`errorMsg "NotAFunctionException" ...
.ns.getFunctionArguments
Now supports types 101, 102, 103 and 104h:
.ns.protectedExecute
Now supports passing functions by value and works with the additional types supported by
.ns.getFunctionArguments
:Error example:
Exceptions
Both now throw
NotAFunctionException
if the value passed is not a function or the reference does not refer to a function: