From 89dbcbbb3d292c612056ed75a35a78ebd6fae3e1 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Wed, 12 Oct 2022 22:36:10 -0400 Subject: feat(tvix/eval): Implement builtins.seq Since we already have infra for forcing arguments to builtins, this ends up being almost *too* simple - we just return the second argument! Change-Id: I070d3d0b551c4dcdac095f67b31e22e0de90cbd7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6999 Reviewed-by: kanepyork Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/builtins/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tvix/eval/src/builtins') diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index e9ad4a8ee82e..a5676a63f895 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -490,6 +490,11 @@ fn pure_builtins() -> Vec { Ok(Value::attrs(NixAttrs::from_map(res))) }, ), + Builtin::new("seq", &[true, true], |mut args: Vec, _: &mut VM| { + // The builtin calling infra has already forced both args for us, so we just return the + // second and ignore the first + Ok(args.pop().unwrap()) + }), Builtin::new("splitVersion", &[true], |args: Vec, _: &mut VM| { let s = args[0].to_str()?; let s = VersionPartsIter::new(s.as_str()); -- cgit 1.4.1