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.
Loading
Please register or sign in to comment