Register | Login

The latest build of the Kynetx Rule Language (KRL) provides a significant upgrade in capability with the addition of functions. We've also added some new array operators that take advantage of functions to make using arrays easier. KRL supports functions as first-class objects in the expression language. KRL supports only anonymous functions, but they can be given names by binding them to a variable in a declaration. Here's an example: pre add5 = function(x) x + 5 ; Functions are evaluated statically (e.g. the environment they are defined in, not the environment they are executed in determines the binding of free-variables) and can be recursive. Here's an example of a recursive function in KRL: pre fact = function(n) n * fact(n-1) Functions are declared using the keyword function. and contain optional declarations followed by a single

Who Voted for this Story



Pligg is an open source content management system that lets you easily create your own social network.