Operations for scalar data types.
More...
|
| function | defined_or (v, d) |
| | Return given value, if defined, or a secondary value, if primary is not defined. More...
|
| |
| function | boolean_or (v, d) |
| | Return given value, if it is Boolean, else return a secondary value, if not. More...
|
| |
| function | number_or (v, d) |
| | Return given value, if it is a number, else return a secondary value, if not. More...
|
| |
| function | string_or (v, d) |
| | Return given value, if it is a string, else return a secondary value, if not. More...
|
| |
| function | list_or (v, d) |
| | Return given value, if it is a list, else return a secondary value, if not. More...
|
| |
| function | index_c (i, l, f=0) |
| | Return a circular index position. More...
|
| |
Operations for scalar data types.
Validation Summary
No Failures
See complete validation results.
◆ boolean_or()
| function boolean_or |
( |
v |
, |
|
|
d |
|
|
) |
| |
Return given value, if it is Boolean, else return a secondary value, if not.
- Parameters
-
| v | <value> A primary value. |
| d | <value> A secondary value. |
- Returns
- <value>
v when it is Boolean and d otherwise.
◆ defined_or()
| function defined_or |
( |
v |
, |
|
|
d |
|
|
) |
| |
Return given value, if defined, or a secondary value, if primary is not defined.
- Parameters
-
| v | <value> A primary value. |
| d | <value> A secondary value. |
- Returns
- <value>
v when it is defined and d otherwise.
The value d is returned only when v is equal to undef.
◆ index_c()
| function index_c |
( |
i |
, |
|
|
l |
, |
|
|
f |
= 0 |
|
) |
| |
Return a circular index position.
- Parameters
-
| i | <integer> A integer position. |
| l | <integer> The range length. |
| f | <integer> The starting index position. |
- Returns
- <integer> The index position mapped into a circular list within the range
[f : l+f-1].
◆ list_or()
| function list_or |
( |
v |
, |
|
|
d |
|
|
) |
| |
Return given value, if it is a list, else return a secondary value, if not.
- Parameters
-
| v | <value> A primary value. |
| d | <value> A secondary value. |
- Returns
- <value>
v when it is a list and d otherwise.
◆ number_or()
| function number_or |
( |
v |
, |
|
|
d |
|
|
) |
| |
Return given value, if it is a number, else return a secondary value, if not.
- Parameters
-
| v | <value> A primary value. |
| d | <value> A secondary value. |
- Returns
- <value>
v when it is a number and d otherwise.
◆ string_or()
| function string_or |
( |
v |
, |
|
|
d |
|
|
) |
| |
Return given value, if it is a string, else return a secondary value, if not.
- Parameters
-
| v | <value> A primary value. |
| d | <value> A secondary value. |
- Returns
- <value>
v when it is a string and d otherwise.