Friendly enough expression language (FEEL) for the purpose of giving standard executable semantics to many kinds of expressions in decision model has the following features;
...
Name and Parameters | Parameter | Description | Example |
---|---|---|---|
list contains(list, element) | list, any element of the semantic domain including null | does the list contain the element ? | list contains([1,2,3], 2) = true |
count(list) | list | return size of list | count([1,2,3]) = 3 |
min(list) | (list of) comparable items | return minimum item | min([1,2,3]) = 1 |
sum(list) | (list of) numbers | return sum of numbers | sum([1,2,3]) = 6 |
mean(list) | (list of) numbers | return arithmetic mean (average) of numbers | mean([1,2,3]) = 2 |
and(list) | (list of) Boolean items | return false if any item is false, else true if all items are true, else null | and([false,null,true]) = false and(false,null,true) = false |
or(list) | (list of) Boolean items | return true if any item is true, else false if all items are false, else null | or([false,null,true]) = true |
sublist(list, start position, length?) | list, number1, number2 | return list of length (or all) elements of list, starting with list[start position]. 1st position is 1, last position is -1 | sublist([1,2,3], 1, 2) = [2] |
append(list, item...) | list, any element including null | return new list with items appended | append([1], 2, 3) = [1,2,3] |
concatenate(list...) | list | return new list that is a concatenation of the arguments | concatenate([1,2],[3]) = [1,2,3] |
insert before(list, position, newItem) | list, number1, any element including null | return new list with newItem inserted at position | insert before([1,3],1,2) = [1,2,3] |
remove(list, position) | list, number1 | list with item at position removed | remove([1,2,3], 2) = [1,3] |
reverse(list) | list | reverse the list | reverse([1,2,3]) = [3,2,1] |
index of(list, match) | list, any element including null | return ascending list of list positions containing match | index of([1,2,3,2],2) = [2,4] |
union(list...) | list | concatenate with duplicate removal | union([1,2],[2,3]) = [1,2,3] |
distinct values(list) | list | duplicate removal | distinct values([1,2,3,2,1] = [1,2,3] |
flatten(list) | list | flatten nested lists | flatten([[1,2],[[3]], 4]) = [1,2,3,4] |
...