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:
parent
17d6f4320f
commit
0ad059ddfe
1 changed files with 15 additions and 15 deletions
|
@ -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>||</code> | Logical `OR` |
|
|
||||||
| `e1 -> e2` | Logical implication (i.e. <code>!e1 || 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>||</code> | Logical `OR` |
|
||||||
|
| `e1 -> e2` | Logical implication (i.e. <code>!e1 || 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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue