error on unknown function

This commit is contained in:
2024-01-03 21:59:40 +01:00
parent 7b75e5dafe
commit 009218c6f9

View File

@@ -7,6 +7,7 @@
#include <functional>
#include <stack>
#include <stdexcept>
#include <string>
#include "Command.h"
@@ -131,6 +132,7 @@ Handle Compiler::compile(const Handle &src, Handle fake_env, const Handle &suffi
out.append(make_cmd(LD));
Handle idx = findIndex(car, fake_env);
if (idx.null()) throw std::invalid_argument("Could not find function to apply: " + std::string(car.strval()));
out.append(idx);
out.append(make_cmd(AP));
}