mirror of
https://github.com/NixOS/rfcs.git
synced 2025-12-18 15:01:20 +01:00
use the proposed version syntax in examples
This commit is contained in:
parent
38793cf4d5
commit
cc5b1b41fa
1 changed files with 8 additions and 8 deletions
|
|
@ -513,13 +513,13 @@ nix --supported-language-versions
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# a.nix
|
# a.nix
|
||||||
use 6;
|
version 6;
|
||||||
builtins.langVersion
|
builtins.langVersion
|
||||||
```
|
```
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# b.nix
|
# b.nix
|
||||||
use 7;
|
version 7;
|
||||||
[ (import ./a.6.nix) builtins.langVersion ]
|
[ (import ./a.6.nix) builtins.langVersion ]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -532,13 +532,13 @@ $ nix-instantiate --eval b.nix
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# a.nix
|
# a.nix
|
||||||
use 6;
|
version 6;
|
||||||
import ./b.nix
|
import ./b.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# b.nix
|
# b.nix
|
||||||
use 7;
|
version 7;
|
||||||
builtins.langVersion
|
builtins.langVersion
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -552,14 +552,14 @@ error: unsupported Nix language version 7
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# a.nix
|
# a.nix
|
||||||
use 6;
|
version 6;
|
||||||
{ increment }:
|
{ increment }:
|
||||||
increment 1
|
increment 1
|
||||||
```
|
```
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# b.nix
|
# b.nix
|
||||||
use 7;
|
version 7;
|
||||||
import ./a.nix { increment = x: x + 1 }
|
import ./a.nix { increment = x: x + 1 }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -577,7 +577,7 @@ When passing values from newer versions to functions from older versions of the
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# a.nix
|
# a.nix
|
||||||
use 6;
|
version 6;
|
||||||
{ value }:
|
{ value }:
|
||||||
value + 1
|
value + 1
|
||||||
```
|
```
|
||||||
|
|
@ -586,7 +586,7 @@ Here we pretend that langauge version 7 introduced a new value type and syntax f
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# b.nix
|
# b.nix
|
||||||
use 7;
|
version 7;
|
||||||
import ./a.nix { value = %5 + 7i%; }
|
import ./a.nix { value = %5 + 7i%; }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue