From 0063e7e913c199538fe67d55e714dd34c09cece3 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Thu, 13 Oct 2022 00:12:25 -0400 Subject: feat(nix/eval): Implement builtins.functionArgs Now that we're tracking formals on Lambda this ends up being quite easy; we just pull them off of the Lambda for the argument closure and use them to construct the result attribute set. Change-Id: I811cb61ec34c6bef123a4043000b18c0e4ea0125 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7003 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/value/attrs.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/eval/src/value/attrs.rs') diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index 6ee3efee679b..a67fd2f3e359 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -127,6 +127,10 @@ mod arbitrary { } impl NixAttrs { + pub fn empty() -> Self { + Self(AttrsRep::Empty) + } + /// Return an attribute set containing the merge of the two /// provided sets. Keys from the `other` set have precedence. pub fn update(self, other: Self) -> Self { -- cgit 1.4.1