with
any →
with(
...projections: entry,
body: expression
) → any
Evaluates named projections independently against the input, then evaluates a body expression against their temporary record.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projections | entry | Variadic (one or more) | One or more named projections evaluated independently against the input value. |
body | expression | Yes | The final expression evaluated against the temporary projection record. |
Argument evaluation
projections: Each supplied expression is evaluated once against the value entering this call.body: Evaluated once against the temporary record produced by the named projections.
Examples
{firstName := "John", lastName := "Doe"} | with(last-name := .lastName, first-name := .firstName, .last-name | suffix(", ") | suffix(.first-name)) → "Doe, John"
Kind: Function
Scope: record
Aliases: None