diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-12-12T16·14+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-12-12T16·14+0000 |
commit | 1a7e88bbd9290987e72616d42c9e9d344acc2a86 (patch) | |
tree | 6eb4f83ec6270a30cb137b5e84d0c380354bb5cb /tests/lang/eval-okay-attrnames.nix | |
parent | 5e6699188fba38619dc23c0b65ee70849f90ea6c (diff) |
* New built-in function `builtins.attrNames' that returns the
names of the attributes in an attribute set.
Diffstat (limited to 'tests/lang/eval-okay-attrnames.nix')
-rw-r--r-- | tests/lang/eval-okay-attrnames.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-attrnames.nix b/tests/lang/eval-okay-attrnames.nix new file mode 100644 index 000000000000..978138f0c0d9 --- /dev/null +++ b/tests/lang/eval-okay-attrnames.nix @@ -0,0 +1,11 @@ +with import ./lib.nix; + +let + + attrs = {y = "y"; x = "x"; foo = "foo";} // rec {x = "newx"; bar = x;}; + + names = builtins.attrNames attrs; + + values = map (name: builtins.getAttr name attrs) names; + +in concat values |