Source-file update for PR 1634 (#1635)

This commit is contained in:
John Kerl 2024-08-27 11:42:24 -04:00 committed by GitHub
parent b63f66ff8c
commit ab637328cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -157,7 +157,7 @@ a=wye,b=pan,i=5,x=0.573288,y=0.863624
!!! note
You can use positional field names only in `DSL` syntax, so only with the verbs `put` and `filter`.
You can use positional field names only in the [Miller DSL](reference-dsl.md), i.e. only with the verbs `put` and `filter`.
## Out-of-stream variables

View file

@ -80,6 +80,10 @@ GENMD-RUN-COMMAND
mlr put '$[[[6]]] = "NEW"' data/small
GENMD-EOF
!!! note
You can use positional field names only in the [Miller DSL](reference-dsl.md), i.e. only with the verbs `put` and `filter`.
## Out-of-stream variables
These are prefixed with an at-sign, e.g. `@sum`. Furthermore, unlike built-in variables and stream-record fields, they are maintained in an arbitrarily nested map: you can do `@sum += $quantity`, or `@sum[$color] += $quantity`, or `@sum[$color][$shape] += $quantity`. The keys for the multi-level map can be any expression which evaluates to string or integer: e.g. `@sum[NR] = $a + $b`, `@sum[$a."-".$b] = $x`, etc.