1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

Merge branch 'dynamic-attrs-no-sugar' of github.com:shlevy/nix

This commit is contained in:
Eelco Dolstra 2014-01-06 15:46:18 +01:00
commit 7a61c88dbb
10 changed files with 249 additions and 63 deletions

View file

@ -0,0 +1 @@
true

View file

@ -0,0 +1 @@
{ a."${"b"}" = true; a."${"c"}" = false; }.a.b

View file

@ -0,0 +1 @@
{ binds = true; hasAttrs = true; multiAttrs = true; recBinds = true; selectAttrs = true; selectOrAttrs = true; }

View file

@ -0,0 +1,17 @@
let
aString = "a";
bString = "b";
in {
hasAttrs = { a.b = null; } ? "${aString}".b;
selectAttrs = { a.b = true; }.a."${bString}";
selectOrAttrs = { }."${aString}" or true;
binds = { "${aString}"."${bString}c" = true; }.a.bc;
recBinds = rec { "${bString}" = a; a = true; }.b;
multiAttrs = { "${aString}" = true; "${bString}" = false; }.a;
}

View file

@ -0,0 +1 @@
false

View file

@ -0,0 +1,3 @@
let
throw = abort "Error!";
in (builtins.tryEval <foobaz>).success