[filter]
filter is a core slot, one of the keywords of the Hyperlambda language, in Hyperlambda, the language of Magic Cloud. Filters selected nodes using the child lambda as a predicate.
- Value (
node-list), required: Expression selecting the nodes to filter - Returns: Resolves to clones of the selected nodes whose predicate body returns true
Arguments
Required arguments come first, then the optional ones in the order they are declared.
| Argument | Type | Required | Description |
|---|---|---|---|
| any node name | lambda | yes | Predicate body evaluated once per selected node; the selected node is kept when the body returns true. Can be repeated. |
Guide: How to use [filter]
JSON declaration
This is the complete declaration of filter, as the running system describes it. It is also published as slot.json.
JSON declaration
{
"name": "filter",
"description": "Filters selected nodes using the child lambda as a predicate",
"signature": {
"input": {
"kind": "node-list",
"description": "Expression selecting the nodes to filter",
"required": true,
"mode": "Expression"
},
"children": {
"*": {
"type": "lambda",
"kind": "boolean",
"description": "Predicate body evaluated once per selected node; the selected node is kept when the body returns true",
"required": true,
"mode": "ExecutableLambda",
"cardinality": "OneOrMore",
"role": "Condition",
"evaluation": "EvalSelf",
"projection": "ReturnedResult"
}
},
"output": {
"mode": "Lambda",
"kind": "node-list",
"description": "Resolves to clones of the selected nodes whose predicate body returns true"
}
}
}
← exists |
all core slots | floatArray2bytes → |