Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into string-to-bool-conv
Browse files Browse the repository at this point in the history
  • Loading branch information
l46kok committed Aug 6, 2024
2 parents 1ff4d42 + ba1df2a commit 1148f9c
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions doc/langdef.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,27 +704,27 @@ macros are:
rest to `false`. Any other combination of boolean results evaluates to
`false`, and any predicate error causes the macro to raise an error.
* `e.map(x, t)`:
* transforms a list `e` by taking each element `x` to the
function given by the expression `t`, which can use the variable `x`. For
instance, `[1, 2, 3].map(n, n * n)` evaluates to `[1, 4, 9]`. Any evaluation
error for any element causes the macro to raise an error.
* transforms a map `e` by taking each key in the map `x` to the function
given by the expression `t`, which can use the variable `x`. For
instance, `{'one': 1, 'two': 2}.map(k, k)` evaluates to `['one', 'two']`.
Any evaluation error for any element causes the macro to raise an error.
* transforms a list `e` by taking each element `x` to the
function given by the expression `t`, which can use the variable `x`. For
instance, `[1, 2, 3].map(n, n * n)` evaluates to `[1, 4, 9]`. Any evaluation
error for any element causes the macro to raise an error.
* transforms a map `e` by taking each key in the map `x` to the function
given by the expression `t`, which can use the variable `x`. For
instance, `{'one': 1, 'two': 2}.map(k, k)` evaluates to `['one', 'two']`.
Any evaluation error for any element causes the macro to raise an error.
* `e.map(x, p, t)`: Same as the two-arg map but with a conditional `p` filter
before the value is transformed.
* `e.filter(x, p)`:
* for a list `e`, returns the sublist of all elements `x` which
evaluate to `true` in the predicate expression `p` (which can use variable
`x`). For instance, `[1, 2, 3].filter(i, i % 2 > 0)` evaluates to `[1, 3]`.
If no elements evaluate to `true`, the result is an empty list. Any
evaluation error for any element causes the macro to raise an error.
* for a map `e`, returns the list of all map keys `x` which
evaluate to `true` in the predicate expression `p` (which can use variable
`x`). For instance, `{'one': 1, 'two': 2}.filter(k, k == 'one')` evaluates
to `['one']`. If no elements evaluate to `true`, the result is an empty
list. Any evaluation error for any element causes the macro to raise an error.
* for a list `e`, returns the sublist of all elements `x` which
evaluate to `true` in the predicate expression `p` (which can use variable
`x`). For instance, `[1, 2, 3].filter(i, i % 2 > 0)` evaluates to `[1, 3]`.
If no elements evaluate to `true`, the result is an empty list. Any
evaluation error for any element causes the macro to raise an error.
* for a map `e`, returns the list of all map keys `x` which
evaluate to `true` in the predicate expression `p` (which can use variable
`x`). For instance, `{'one': 1, 'two': 2}.filter(k, k == 'one')` evaluates
to `['one']`. If no elements evaluate to `true`, the result is an empty
list. Any evaluation error for any element causes the macro to raise an error.

### Field Selection

Expand Down

0 comments on commit 1148f9c

Please sign in to comment.