Adaptive Framework
0.9.0
|
Adaptive Function union<boolean>
More...
Adaptive Function union<boolean>
x | function execute parameter. |
Returns a list of boolean contains all of the unique values in two or more list of boolean values.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
lists - (2 or more list boolean) Two or more lists.
Returns:
(list boolean)
Implemented by afw_function_execute_union()
compiler adaptive functions.
const afw_value_t* afw_function_execute_assert | ( | afw_function_execute_t * | x | ) |
Adaptive Function assert
x | function execute parameter. |
Assert that a value is true. If not, an assertion_failed error is thrown.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
assertion - (boolean) This is the assertion to make. If not true, an assertion_failed error is thrown.
reason - (optional string) This is an optional reason to include in the assertion_failed message.
Returns:
(null)
Definition at line 54 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_compile_expression_tuple | ( | afw_function_execute_t * | x | ) |
Adaptive Function compile_expression_tuple
x | function execute parameter. |
Compile a string containing adaptive expression tuple syntax and return either an unevaluated expression tuple adaptive value or a string containing the compiler listing.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
expression_tuple - (list) expression tuple to compile.
listing - (optional any dataType) If specified, a compiler listing is produced instead of an unevaluated expression tuple value.
This parameter can be an integer between 0 and 10 of a string that is used for indentation. If 0 is specified, no whitespace is added to the resulting string. If 1 through 10 is specified, that number of spaces is used.
Returns:
(any dataType) An unevaluated expression tuple value ready for use by function evaluate() or a string containing the compiler listing.
Definition at line 170 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_compile_json | ( | afw_function_execute_t * | x | ) |
Adaptive Function compile_json
x | function execute parameter. |
Compile a string containing adaptive JSON syntax and return either an unevaluated JSON adaptive value or a string containing the compiler listing.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
json - (string) JSON string to compile.
listing - (optional any dataType) If specified, a compiler listing is produced instead of an unevaluated JSON value.
This parameter can be an integer between 0 and 10 of a string that is used for indentation. If 0 is specified, no whitespace is added to the resulting string. If 1 through 10 is specified, that number of spaces is used.
Returns:
(any dataType) An unevaluated JSON value ready for use by function evaluate() or a string containing the compiler listing.
Definition at line 240 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_compile_relaxed_json | ( | afw_function_execute_t * | x | ) |
Adaptive Function compile_relaxed_json
x | function execute parameter. |
Compile an adaptive relaxed JSON syntax string and return an adaptive value.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
json - (string) Adaptive relaxed JSON syntax string to compile.
listing - (optional any dataType) If specified, a compiler listing is produced instead of an unevaluated relaxed JSON value.
This parameter can be an integer between 0 and 10 of a string that is used for indentation. If 0 is specified, no whitespace is added to the resulting string. If 1 through 10 is specified, that number of spaces is used.
Returns:
(any dataType) An unevaluated relaxed JSON value ready for use by function evaluate() or a string containing the compiler listing.
Definition at line 306 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_convert_syntax_hybrid_to_expression | ( | afw_function_execute_t * | x | ) |
Adaptive Function convert_syntax_hybrid_to_expression
x | function execute parameter. |
Convert a string containing adaptive hybrid syntax, which can be an adaptive template or adaptive expression tuple, to adaptive expression syntax.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
hybrid - (string) The hybrid to convert.
whitespace - (optional any dataType) Add whitespace for readability if present and not 0. This parameter can be an integer between 0 and 10 or a string that is used for indentation. If 0 is specified, no whitespace is added to the resulting string. If 1 through 10 is specified, that number of spaces is used.
Returns:
(expression) The converted value in adaptive expression syntax.
Definition at line 370 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_decompile | ( | afw_function_execute_t * | x | ) |
Adaptive Function decompile
x | function execute parameter. |
Decompile an adaptive value to string.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
value - (any dataType) Value to decompile.
whitespace - (optional any dataType) Add whitespace for readability if present and not 0. This parameter can be an integer between 0 and 10 or a string that is used for indentation. If 0 is specified, no whitespace is added to the resulting string. If 1 through 10 is specified, that number of spaces is used.
Returns:
(string) Decompiled value.
Definition at line 429 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_evaluate_expression_tuple | ( | afw_function_execute_t * | x | ) |
Adaptive Function evaluate_expression_tuple
x | function execute parameter. |
Compile a string containing adaptive expression tuple syntax and then evaluate the result.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
expression_tuple - (string) Expression tuple to compile and evaluate.
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(any dataType) Evaluated adaptive expression tuple.
Definition at line 482 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_evaluate_value | ( | afw_function_execute_t * | x | ) |
Adaptive Function evaluate_value
x | function execute parameter. |
Evaluate an adaptive value.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
value - (any dataType)
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(any dataType) Evaluated adaptive value.
Definition at line 547 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_evaluate_with_retry | ( | afw_function_execute_t * | x | ) |
Adaptive Function evaluate_with_retry
x | function execute parameter. |
Evaluate a value and retry up to a limit if an exception occurs.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
value - (any dataType) Value to evaluated.
limit - (integer) Maximum number to retry if an exception occurs.
Returns:
(any dataType) Evaluated value.
Definition at line 598 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_qualifier | ( | afw_function_execute_t * | x | ) |
Adaptive Function qualifier
x | function execute parameter. |
This function allows the active variables for a qualifier to be accessed as the properties of an object.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
qualifier - (string) This is the qualifier whose variables are to be accessed as properties of the returned object.
forTesting - (optional boolean) If specified and true, the object returned will be suitable to pass as the additionalUntrustedQualifiedVariables parameter of evaluate*() functions. This is intended for testing purposes and should not be used in production.
Returns:
(object) Each property is the name of a variable with the value influenced by the forTesting property.
Definition at line 1575 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_qualifiers | ( | afw_function_execute_t * | x | ) |
Adaptive Function qualifiers
x | function execute parameter. |
This function allows the active qualifiers to be accessed as properties of an object. The value of each of these properties is an object whose properties are the variables for the corresponding qualifier.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
forTesting - (optional boolean) If specified and true, the object returned will be suitable to pass as the additionalUntrustedQualifiedVariables parameter of evaluate*() functions. This is intended for testing purposes and should not be used in production.
Returns:
(object) Each property is the name of a qualifier with a value that is an object whose properties are the variables of that qualifier. The value of the variable properties is influenced by the forTesting property.
Definition at line 1633 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_safe_evaluate | ( | afw_function_execute_t * | x | ) |
Adaptive Function safe_evaluate
x | function execute parameter. |
Return the evaluated adaptive value. If an exception occurs, return evaluated error instead.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
value - (any dataType) Value to evaluated.
error - (any dataType) Value to evaluate and return if exception occurs. If an error occurs evaluating this value, the exception will continue.
Returns:
(any dataType) Evaluated adaptive value or error value.
Definition at line 674 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_stringify | ( | afw_function_execute_t * | x | ) |
Adaptive Function stringify
x | function execute parameter. |
Evaluate and decompile an adaptive value to string. For most values this has the effect of producing a string containing json.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
value - (any dataType) Value to stringify.
replacer - (optional any dataType) Optional replacer function.
whitespace - (optional any dataType) Add whitespace for readability if present and not 0. This parameter can be an integer between 0 and 10 or a string that is used for indentation. If 0 is specified, no whitespace is added to the resulting string. If 1 through 10 is specified, that number of spaces is used.
Returns:
(string) Evaluated and decompiled value.
Definition at line 740 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_test_expression | ( | afw_function_execute_t * | x | ) |
Adaptive Function test_expression
x | function execute parameter. |
Compile and evaluate an adaptive expression and compare the results to an expected value. Return object with the test's results.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
id - (string) Id of test.
description - (string) Description of test.
expression - (string) Expression to compile and evaluate.
expected - (any dataType) Expected result.
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(object) Test results.
Definition at line 823 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_test_expression_tuple | ( | afw_function_execute_t * | x | ) |
Adaptive Function test_expression_tuple
x | function execute parameter. |
Compile and evaluate an adaptive expression tuple and compare the results to an expected value. Return object with the test's results.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
id - (string) Id of test.
description - (string) Description of test.
expression - (string) Expression tuple to compile and evaluate.
expected - (any dataType) Expected result.
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(object) Test results.
Definition at line 950 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_test_hybrid | ( | afw_function_execute_t * | x | ) |
Adaptive Function test_hybrid
x | function execute parameter. |
Compile and evaluate a string containing adaptive hybrid syntax which can be an adaptive template or adaptive expression tuple and then compare the results to an expected value. Return object with the test's results.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
id - (string) Id of test.
description - (string) Description of test.
hybrid - (string) Hybrid to compile and evaluate.
expected - (any dataType) Expected evaluated result.
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(object) Test results.
Definition at line 1078 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_test_script | ( | afw_function_execute_t * | x | ) |
Adaptive Function test_script
x | function execute parameter. |
Compile and evaluate an adaptive script and compare the results to an expected value. Return object with the test's results.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
id - (string) Id of test.
description - (string) Description of test.
script - (string) Script to compile and evaluate.
expected - (any dataType) Expected result.
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(object) Test results.
Definition at line 1205 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_test_script_runtime_support | ( | afw_function_execute_t * | x | ) |
Adaptive Function test_script_runtime_support
x | function execute parameter. |
This is a function called internally as the result of a test_script compile. This function is not intended to be called directly.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
testScriptObject - (object AdaptiveTestScriptResult) A test script results object with the required evaluation result properties missing. The sources will be evaluated and the corresponding test result properties will be set.
Returns:
(object AdaptiveTestScriptResult) The testScriptObject object with test result properties set.
Definition at line 1685 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_test_template | ( | afw_function_execute_t * | x | ) |
Adaptive Function test_template
x | function execute parameter. |
Compile and evaluate an adaptive template and compare the results to an expected value. Return object with the test's results.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
id - (string) Id of test.
description - (string) Description of test.
template - (string) Template to compile and evaluate.
expected - (any dataType) Expected evaluated result.
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(object) Test results.
Definition at line 1332 of file afw_function_compiler.c.
const afw_value_t* afw_function_execute_test_value | ( | afw_function_execute_t * | x | ) |
Adaptive Function test_value
x | function execute parameter. |
Evaluate an adaptive value and compare it to an expected value. Return object with the test's results.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
id - (string) Id of test.
description - (string) Description of test.
value - (string) Value to evaluate.
expected - (any dataType) Expected result.
additionalUntrustedQualifiedVariables - (optional object AdaptiveHybridPropertiesObjects) This parameter supplies additional qualified variables that can be accessed during evaluation. These variables will not be used by anything that needs to ensure its qualified variables must come from a trusted source, such as authorization. This parameter is intended to be used for testing only and should not be used for anything running in production.
Returns:
(object) Test results.
Definition at line 1459 of file afw_function_compiler.c.