diff options
Diffstat (limited to 'tvix/eval/src/value/builtin.rs')
-rw-r--r-- | tvix/eval/src/value/builtin.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tvix/eval/src/value/builtin.rs b/tvix/eval/src/value/builtin.rs index 8d7e82136125..84582e298586 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. |