mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
De-emphasize deprecated |-operator in docs and examples
This commit is contained in:
parent
1c099f84c6
commit
3008b99b41
4 changed files with 5 additions and 5 deletions
|
|
@ -22,9 +22,8 @@ Language:
|
|||
|
||||
* Add [unpack](syntax.md#unpack): `..` and `...` syntax that can be used inside
|
||||
lists, sets, and dicts to unpack one collection into another.
|
||||
* Unpack can be used to express dict and set unions without the need for
|
||||
the `|` operator. As such, the `|` operator is now deprecated, and will
|
||||
be removed in a future version.
|
||||
* The `|` operator is now deprecated, and will be removed in a future version.
|
||||
The new unpack feature can be used to express dict and set unions instead.
|
||||
* [Assertions](syntax.md#assertions) now use a `:` to separate the condition
|
||||
and the message: `assert cond: "message";` rather than
|
||||
`assert cond, "message";`. For compatibility, <abbr>RCL</abbr> still accepts
|
||||
|
|
|
|||
|
|
@ -290,7 +290,6 @@ Binary operators that operate between two expressions, e.g. `x and y`:
|
|||
| `<=` | Less than or equal to |
|
||||
| `>` | Greater than |
|
||||
| `>=` | Greater than or equal to |
|
||||
| `|` | Set or dict union, right-biased for dicts |
|
||||
| `+` | Numeric addition |
|
||||
| `-` | Numeric subtraction |
|
||||
| `*` | Numeric multiplication |
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ to handle optional keys gracefully.
|
|||
|
||||
## Union operator
|
||||
|
||||
**This operator is deprecated.** Use [unpack](#union) instead.
|
||||
|
||||
The `|` operator returns the union of two dictionaries. When a key occurs on
|
||||
both sides, the value is taken from the right side.
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@ let var = {
|
|||
for tag in tags:
|
||||
tag
|
||||
};
|
||||
host: group_tags | device_tags
|
||||
host: { ..group_tags, ..device_tags }
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue