about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/builtin.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tvix/eval/src/value/builtin.rs b/tvix/eval/src/value/builtin.rs
index 8d7e821361..84582e2985 100644
--- a/tvix/eval/src/value/builtin.rs
+++ b/tvix/eval/src/value/builtin.rs
@@ -34,6 +34,19 @@ pub struct Builtin {
 }
 
 impl Builtin {
+    pub fn new(name: &'static str, arity: usize, func: BuiltinFn) -> Self {
+        Builtin {
+            name,
+            arity,
+            func,
+            partials: vec![],
+        }
+    }
+
+    pub fn name(&self) -> &'static str {
+        self.name
+    }
+
     /// Apply an additional argument to the builtin, which will either
     /// lead to execution of the function or to returning a partial
     /// builtin.