From 1a7e88bbd9290987e72616d42c9e9d344acc2a86 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 12 Dec 2006 16:14:31 +0000 Subject: * New built-in function `builtins.attrNames' that returns the names of the attributes in an attribute set. --- tests/lang/eval-okay-attrnames.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/lang/eval-okay-attrnames.nix (limited to 'tests/lang/eval-okay-attrnames.nix') diff --git a/tests/lang/eval-okay-attrnames.nix b/tests/lang/eval-okay-attrnames.nix new file mode 100644 index 0000000000..978138f0c0 --- /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 -- cgit 1.4.1