about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.exp
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-20T20·47+0300
committertazjin <tazjin@tvl.su>2022-09-20T23·37+0000
commit876c4772563e8129e069f1d107b2a21378609ace (patch)
treed134db45d8a05b2579d725683afd1526f95cbc91 /tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.exp
parent82079776486870e6c8e6e6e6c9b56b9e91e0a181 (diff)
feat(tvix/eval): implement builtins.map r/4941
As we already have a VM passed to the builtins, we can simply execute
the provided closure/lambda in it for each value.

The primary annoyance with this is that we have to clone the upvalues
for each element, but we can try making this cheaper in the
future (it's also a general problem in the VM itself).

Change-Id: I5bcf56d58c509c0eb081e7cf52f6093216451ce4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6714
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.exp')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.exp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.exp
new file mode 100644
index 000000000000..e1ff70800245
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.exp
@@ -0,0 +1 @@
+[ [ 1 2 3 4 5 ] [ 2 4 6 8 10 ] [ 2 4 6 8 10 ] [ 1 2 3 4 5 ] ]