[case]

case is a core slot, one of the keywords of the Hyperlambda language, in Hyperlambda, the language of Magic Cloud. Evaluates a single case branch inside [switch].

  • Value (switch-value), required: Case value to match against the [switch] input value

Arguments

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

Argument Type Required Description
any node name lambda yes Case branch body executed by the parent [switch]. Can be repeated.

Constraints

  • ParentMustBe: Parent node must have the listed slot name ([switch])

JSON declaration

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

JSON declaration
{
  "name": "case",
  "description": "Evaluates a single case branch inside [switch]",
  "signature": {
    "input": {
      "kind": "switch-value",
      "description": "Case value to match against the [switch] input value",
      "required": true,
      "mode": "ValueOrExpression"
    },
    "children": {
      "*": {
        "type": "lambda",
        "description": "Case branch body executed by the parent [switch]",
        "required": true,
        "mode": "ExecutableLambda",
        "cardinality": "OneOrMore",
        "role": "ExecutableBody",
        "evaluation": "EvalSelf",
        "projection": "Self"
      }
    },
    "constraints": [
      {
        "description": "Parent node must have the listed slot name",
        "values": [
          "switch"
        ],
        "kind": "ParentMustBe"
      }
    ]
  }
}

← apply all core slots compose →