Module lyaml.functional
Functions
isnull (x) | lyaml.null predicate. |
iscallable (x) | Callable predicate. |
anyof (fns) | Compose a function to try each callable with supplied args. |
id (...) | Return arguments unchanged. |
Tables
NULL | lyaml.null value. |
Functions
- isnull (x)
-
lyaml.null
predicate.Parameters:
- x operand
Returns:
-
bool
true
if x islyaml.null
. - iscallable (x)
-
Callable predicate.
Parameters:
- x operand
Returns:
-
bool
true
if x is a function has a __call metamethodUsage:
r = iscallable(x) and x(...)
- anyof (fns)
-
Compose a function to try each callable with supplied args.
Parameters:
- fns table list of functions to try
Returns:
-
function
a new function to call ... functions, stopping
and returning the first non-nil result, if any
- id (...)
-
Return arguments unchanged.
Parameters:
- ... arguments
Returns:
-
...