docs(nix-1p): fix formatting of operator table

Change-Id: I19a10114bf4a816e3573eb86df208b68548884a1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9598
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
Vincent Ambo 2023-10-10 13:47:30 +03:00 committed by clbot
parent 17d6f4320f
commit 0ad059ddfe

View file

@ -113,23 +113,23 @@ rec { a = 15; b = a * 2; }
Nix has several operators, most of which are unsurprising: Nix has several operators, most of which are unsurprising:
| Syntax | Description |
|----------------------|-----------------------------------------------------------------------------|
| `+`, `-`, `*`, `/` | Numerical operations |
| `+` | String concatenation |
| `++` | List concatenation |
| `==` | Equality |
| `>`, `>=`, `<`, `<=` | Ordering comparators |
| `&&` | Logical `AND` |
| <code>&vert;&vert;</code> | Logical `OR` |
| `e1 -> e2` | Logical implication (i.e. <code>!e1 &vert;&vert; e2</code>) |
| `!` | Boolean negation |
| `set.attr` | Access attribute `attr` in attribute set `set` |
| `set ? attribute` | Test whether attribute set contains an attribute |
| `left // right` | Merge `left` & `right` attribute sets, with the right set taking precedence |
Make sure to understand the `//`-operator, as it is used quite a lot and is Make sure to understand the `//`-operator, as it is used quite a lot and is
probably the least familiar one. probably the least familiar one.
| Syntax | Description |
|---------------------------|-----------------------------------------------------------------------------|
| `+`, `-`, `*`, `/` | Numerical operations |
| `+` | String concatenation |
| `++` | List concatenation |
| `==` | Equality |
| `>`, `>=`, `<`, `<=` | Ordering comparators |
| `&&` | Logical `AND` |
| <code>&vert;&vert;</code> | Logical `OR` |
| `e1 -> e2` | Logical implication (i.e. <code>!e1 &vert;&vert; e2</code>) |
| `!` | Boolean negation |
| `set.attr` | Access attribute `attr` in attribute set `set` |
| `set ? attribute` | Test whether attribute set contains an attribute |
| `left // right` | Merge `left` & `right` attribute sets, with the right set taking precedence |
## Variable bindings ## Variable bindings