refactor(tvix/eval): pass a VM reference to builtins

This makes it possible for builtins to force values on their own,
without the VM having to apply a strictness mask to the arguments
first.

Change-Id: Ib49a94e56ca2a8d515c39647381ab55a727766e3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6411
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-09-02 04:38:37 +03:00 committed by tazjin
parent 5ee89bcf5c
commit 0d7ad5e6d1
3 changed files with 34 additions and 24 deletions

View file

@ -418,7 +418,7 @@ impl VM {
Value::Builtin(builtin) => {
let arg = self.pop();
let result = fallible!(self, builtin.apply(arg));
let result = fallible!(self, builtin.apply(self, arg));
self.push(result);
}
_ => return Err(self.error(ErrorKind::NotCallable)),