snix/tvix/eval/src/value
Vincent Ambo 8f2004d360 refactor(tvix/eval): add VM::call_value helper method
This makes it possible to call a callable value (builtin or
closure/lambda) directly, without unwrapping it first. This is needed
for pretty much all higher-order functions to work correctly.

This is mostly equivalent to the previous code in coerce_to_string for
calling `__toString`, except it expects the argument(s) to already be
placed on the stack.

Note that the span for the `NotCallable` error is not currently
guaranteed to make any sense, will experiment with this.

Change-Id: I821224368d438a28900858b343defc1817e46a0a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6717
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-20 23:48:57 +00:00
..
attrs test(tvix/eval): Make proptests a bit smaller 2022-09-20 23:41:58 +00:00
arbitrary.rs test(tvix/eval): Make proptests a bit smaller 2022-09-20 23:41:58 +00:00
attrs.rs chore(tvix/eval): Pass in VM to nix_eq 2022-09-18 22:03:42 +00:00
builtin.rs refactor(tvix/eval): handle forcing in Builtin::apply 2022-09-19 09:58:14 +00:00
function.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
list.rs chore(tvix/eval): Pass in VM to nix_eq 2022-09-18 22:03:42 +00:00
mod.rs refactor(tvix/eval): add VM::call_value helper method 2022-09-20 23:48:57 +00:00
string.rs test(tvix/eval): Add proptests covering trait impls for String 2022-09-17 19:51:16 +00:00
thunk.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00