[for-each]

for-each is a core slot, one of the keywords of the Hyperlambda language, in Hyperlambda, the language of Magic Cloud. Iterates over the nodes matching the expression and evaluates the child lambda once per node as [.dp].

  • Value (node-list), required: Expression selecting the nodes to iterate

Arguments

Required arguments come first, then the optional ones in the order they are declared.

Argument Type Required Description
any node name lambda yes Loop body evaluated once per selected node. Can be repeated.

Guide: How to use [for-each]

JSON declaration

This is the complete declaration of for-each, as the running system describes it. It is also published as slot.json.

JSON declaration
{
  "name": "for-each",
  "description": "Iterates over the nodes matching the expression and evaluates the child lambda once per node as [.dp]",
  "signature": {
    "input": {
      "kind": "node-list",
      "description": "Expression selecting the nodes to iterate",
      "required": true,
      "mode": "Expression"
    },
    "children": {
      "*": {
        "type": "lambda",
        "description": "Loop body evaluated once per selected node",
        "required": true,
        "mode": "ExecutableLambda",
        "cardinality": "OneOrMore",
        "role": "ExecutableBody",
        "evaluation": "EvalSelf",
        "projection": "Self"
      }
    }
  }
}

← floatArray2bytes all core slots fork →