Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions | Variables

Adaptive Function union<boolean> More...

Functions

const afw_value_tafw_function_execute_assert (afw_function_execute_t *x)
 Adaptive Function assert More...
 
const afw_value_tafw_function_execute_compile_expression_tuple (afw_function_execute_t *x)
 Adaptive Function compile_expression_tuple More...
 
const afw_value_tafw_function_execute_compile_json (afw_function_execute_t *x)
 Adaptive Function compile_json More...
 
const afw_value_tafw_function_execute_compile_relaxed_json (afw_function_execute_t *x)
 Adaptive Function compile_relaxed_json More...
 
const afw_value_tafw_function_execute_convert_syntax_hybrid_to_expression (afw_function_execute_t *x)
 Adaptive Function convert_syntax_hybrid_to_expression More...
 
const afw_value_tafw_function_execute_decompile (afw_function_execute_t *x)
 Adaptive Function decompile More...
 
const afw_value_tafw_function_execute_evaluate_expression_tuple (afw_function_execute_t *x)
 Adaptive Function evaluate_expression_tuple More...
 
const afw_value_tafw_function_execute_evaluate_value (afw_function_execute_t *x)
 Adaptive Function evaluate_value More...
 
const afw_value_tafw_function_execute_evaluate_with_retry (afw_function_execute_t *x)
 Adaptive Function evaluate_with_retry More...
 
const afw_value_tafw_function_execute_qualifier (afw_function_execute_t *x)
 Adaptive Function qualifier More...
 
const afw_value_tafw_function_execute_qualifiers (afw_function_execute_t *x)
 Adaptive Function qualifiers More...
 
const afw_value_tafw_function_execute_safe_evaluate (afw_function_execute_t *x)
 Adaptive Function safe_evaluate More...
 
const afw_value_tafw_function_execute_stringify (afw_function_execute_t *x)
 Adaptive Function stringify More...
 
const afw_value_tafw_function_execute_test_expression (afw_function_execute_t *x)
 Adaptive Function test_expression More...
 
const afw_value_tafw_function_execute_test_expression_tuple (afw_function_execute_t *x)
 Adaptive Function test_expression_tuple More...
 
const afw_value_tafw_function_execute_test_hybrid (afw_function_execute_t *x)
 Adaptive Function test_hybrid More...
 
const afw_value_tafw_function_execute_test_script (afw_function_execute_t *x)
 Adaptive Function test_script More...
 
const afw_value_tafw_function_execute_test_script_runtime_support (afw_function_execute_t *x)
 Adaptive Function test_script_runtime_support More...
 
const afw_value_tafw_function_execute_test_template (afw_function_execute_t *x)
 Adaptive Function test_template More...
 
const afw_value_tafw_function_execute_test_value (afw_function_execute_t *x)
 Adaptive Function test_value More...
 

Variables

 afw_function_definition_assert
 Function definition assert.
 
 afw_function_definition_compile_expression_tuple
 Function definition compile_expression_tuple.
 
 afw_function_definition_compile_json
 Function definition compile_json.
 
 afw_function_definition_compile_relaxed_json
 Function definition compile_relaxed_json.
 
 afw_function_definition_convert_syntax_hybrid_to_expression
 Function definition convert_syntax_hybrid_to_expression.
 
 afw_function_definition_decompile
 Function definition decompile.
 
 afw_function_definition_evaluate_expression_tuple
 Function definition evaluate_expression_tuple.
 
 afw_function_definition_evaluate_value
 Function definition evaluate_value.
 
 afw_function_definition_evaluate_with_retry
 Function definition evaluate_with_retry.
 
 afw_function_definition_qualifier
 Function definition qualifier.
 
 afw_function_definition_qualifiers
 Function definition qualifiers.
 
 afw_function_definition_safe_evaluate
 Function definition safe_evaluate.
 
 afw_function_definition_stringify
 Function definition stringify.
 
 afw_function_definition_test_expression
 Function definition test_expression.
 
 afw_function_definition_test_expression_tuple
 Function definition test_expression_tuple.
 
 afw_function_definition_test_hybrid
 Function definition test_hybrid.
 
 afw_function_definition_test_script
 Function definition test_script.
 
 afw_function_definition_test_script_runtime_support
 Function definition test_script_runtime_support.
 
 afw_function_definition_test_template
 Function definition test_template.
 
 afw_function_definition_test_value
 Function definition test_value.
 

Detailed Description

Adaptive Function union<boolean>

Parameters
xfunction 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:

function union<boolean>(
lists_1: (list boolean),
lists_2: (list boolean),
...lists_rest: (list of (list boolean))
): (list boolean);

Parameters:

lists - (2 or more list boolean) Two or more lists.

Returns:

(list boolean)

Implemented by afw_function_execute_union()


compiler adaptive functions.

Function Documentation

◆ afw_function_execute_assert()

const afw_value_t* afw_function_execute_assert ( afw_function_execute_t x)

Adaptive Function assert

Parameters
xfunction 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:

function assert(
assertion: boolean,
reason?: string
): null;

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.

◆ afw_function_execute_compile_expression_tuple()

const afw_value_t* afw_function_execute_compile_expression_tuple ( afw_function_execute_t x)

Adaptive Function compile_expression_tuple

Parameters
xfunction 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:

function compile_expression_tuple(
expression_tuple: list,
listing?: any
): any;

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.

◆ afw_function_execute_compile_json()

const afw_value_t* afw_function_execute_compile_json ( afw_function_execute_t x)

Adaptive Function compile_json

Parameters
xfunction 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:

function compile_json(
json: string,
listing?: any
): any;

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.

◆ afw_function_execute_compile_relaxed_json()

const afw_value_t* afw_function_execute_compile_relaxed_json ( afw_function_execute_t x)

Adaptive Function compile_relaxed_json

Parameters
xfunction 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:

function compile_relaxed_json(
json: string,
listing?: any
): any;

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.

◆ afw_function_execute_convert_syntax_hybrid_to_expression()

const afw_value_t* afw_function_execute_convert_syntax_hybrid_to_expression ( afw_function_execute_t x)

Adaptive Function convert_syntax_hybrid_to_expression

Parameters
xfunction 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:

function convert_syntax_hybrid_to_expression(
hybrid: string,
whitespace?: any
): expression;

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.

◆ afw_function_execute_decompile()

const afw_value_t* afw_function_execute_decompile ( afw_function_execute_t x)

Adaptive Function decompile

Parameters
xfunction 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:

function decompile(
value: any,
whitespace?: any
): string;

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.

◆ afw_function_execute_evaluate_expression_tuple()

const afw_value_t* afw_function_execute_evaluate_expression_tuple ( afw_function_execute_t x)

Adaptive Function evaluate_expression_tuple

Parameters
xfunction 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:

function evaluate_expression_tuple(
expression_tuple: string,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): any;

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.

◆ afw_function_execute_evaluate_value()

const afw_value_t* afw_function_execute_evaluate_value ( afw_function_execute_t x)

Adaptive Function evaluate_value

Parameters
xfunction execute parameter.

Evaluate an adaptive value.

This function is not pure, so it may return a different result given exactly the same parameters.

Declaration:

function evaluate_value(
value: any,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): any;

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.

◆ afw_function_execute_evaluate_with_retry()

const afw_value_t* afw_function_execute_evaluate_with_retry ( afw_function_execute_t x)

Adaptive Function evaluate_with_retry

Parameters
xfunction 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:

function evaluate_with_retry(
value: any,
limit: integer
): any;

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.

◆ afw_function_execute_qualifier()

const afw_value_t* afw_function_execute_qualifier ( afw_function_execute_t x)

Adaptive Function qualifier

Parameters
xfunction 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:

function qualifier(
qualifier: string,
forTesting?: boolean
): object;

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.

◆ afw_function_execute_qualifiers()

const afw_value_t* afw_function_execute_qualifiers ( afw_function_execute_t x)

Adaptive Function qualifiers

Parameters
xfunction 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:

function qualifiers(
forTesting?: boolean
): object;

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.

◆ afw_function_execute_safe_evaluate()

const afw_value_t* afw_function_execute_safe_evaluate ( afw_function_execute_t x)

Adaptive Function safe_evaluate

Parameters
xfunction 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:

function safe_evaluate(
value: any,
error: any
): any;

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.

◆ afw_function_execute_stringify()

const afw_value_t* afw_function_execute_stringify ( afw_function_execute_t x)

Adaptive Function stringify

Parameters
xfunction 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:

function stringify(
value: any,
replacer?: any,
whitespace?: any
): string;

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.

Todo:
FIXME: add support for replacer

Definition at line 740 of file afw_function_compiler.c.

◆ afw_function_execute_test_expression()

const afw_value_t* afw_function_execute_test_expression ( afw_function_execute_t x)

Adaptive Function test_expression

Parameters
xfunction 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:

function test_expression(
id: string,
description: string,
expression: string,
expected: any,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): object;

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.

◆ afw_function_execute_test_expression_tuple()

const afw_value_t* afw_function_execute_test_expression_tuple ( afw_function_execute_t x)

Adaptive Function test_expression_tuple

Parameters
xfunction 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:

function test_expression_tuple(
id: string,
description: string,
expression: string,
expected: any,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): object;

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.

◆ afw_function_execute_test_hybrid()

const afw_value_t* afw_function_execute_test_hybrid ( afw_function_execute_t x)

Adaptive Function test_hybrid

Parameters
xfunction 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:

function test_hybrid(
id: string,
description: string,
hybrid: string,
expected: any,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): object;

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.

◆ afw_function_execute_test_script()

const afw_value_t* afw_function_execute_test_script ( afw_function_execute_t x)

Adaptive Function test_script

Parameters
xfunction 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:

function test_script(
id: string,
description: string,
script: string,
expected: any,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): object;

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.

◆ afw_function_execute_test_script_runtime_support()

const afw_value_t* afw_function_execute_test_script_runtime_support ( afw_function_execute_t x)

Adaptive Function test_script_runtime_support

Parameters
xfunction 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:

function test_script_runtime_support(
testScriptObject: (object _AdaptiveTestScriptResult_)
): (object _AdaptiveTestScriptResult_);

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.

◆ afw_function_execute_test_template()

const afw_value_t* afw_function_execute_test_template ( afw_function_execute_t x)

Adaptive Function test_template

Parameters
xfunction 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:

function test_template(
id: string,
description: string,
template: string,
expected: any,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): object;

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.

◆ afw_function_execute_test_value()

const afw_value_t* afw_function_execute_test_value ( afw_function_execute_t x)

Adaptive Function test_value

Parameters
xfunction 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:

function test_value(
id: string,
description: string,
value: string,
expected: any,
additionalUntrustedQualifiedVariables?: (object _AdaptiveHybridPropertiesObjects_)
): object;

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.