walk
any →
walk(
transformation: expression
) → any
Recursively traverses arrays, tuples, and records and evaluates an expression against each leaf value while preserving container shape.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
transformation | expression | Yes | Expression evaluated against every leaf value. |
Argument evaluation
Recursively visits the leaf values in the incoming arrays, tuples, and records.
transformation: Evaluated once against each leaf reached in the incoming structure.
Behavior
walk recursively visits array items, tuple items, and record field values. Record field names and container kinds are preserved, and only leaves are supplied to the transformation. The transformation retains its ordinary semantics, so walk(trim) permits normal coercion while walk(*trim) uses guarded entry.
Examples
T(42, " 42 ") | walk(trim) → T("42", "42")
T(42, " 42 ") | walk(*trim) → T(42, "42")
{name := " Bob ", address := {city := " Brussels "}} | walk(*trim) → {name := "Bob", address := {city := "Brussels"}}
Kind: Function
Scope: structure
Aliases: walk