Commit cda68e29 authored by Stefan's avatar Stefan
Browse files

Fix partial application of builtins

* src/eval.ml (builtin_functions): Rename from _builtin_lookup.
Add arity info for each primitive.
(add_builtin_function): New function.
(_eval): Eval `Call` args before calling eval_call.
(get_predef_eval): Remove unused.
(eval_call): Rewrite.  Signal an error if a builtin throws an
exception: since Typer's language is total this should only happen
if there's a bug in Typer's own code.
(bind_impl): Use eval_call; simplify.
(get_builtin_impl): Remove.  Pre-fill builtin_functions instead.

* src/elexp.ml (elexp_string): Add deb-indices in output.

* tests/eval_test.ml ("Partial Application"): Also test partial
application of builtins.
parent 96d9936b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment