add description

This commit is contained in:
water
2020-09-14 16:45:42 -04:00
parent 28cd6a7e65
commit a74ed941ae
5 changed files with 518 additions and 8 deletions
+13 -7
View File
@@ -203,13 +203,6 @@ Val* Compiler::compile_function_or_method_call(const goos::Object& form, Env* en
typecheck(form, m_ts.make_typespec("function"), head->type(), "Function call head");
}
// compile arguments
std::vector<RegVal*> eval_args;
for (uint32_t i = 1; i < args.unnamed.size(); i++) {
auto intermediate = compile_error_guard(args.unnamed.at(i), env);
eval_args.push_back(intermediate->to_reg(env));
}
// see if its an "immediate" application. This happens in three cases:
// 1). the user directly puts a (lambda ...) form in the head (like with a (let) macro)
// 2). the user used a (inline my-func) to grab the LambdaPlace of the function.
@@ -223,6 +216,19 @@ Val* Compiler::compile_function_or_method_call(const goos::Object& form, Env* en
head_as_lambda = dynamic_cast<LambdaVal*>(head);
}
if(!head_as_lambda) {
head = head->to_gpr(env);
}
// compile arguments
std::vector<RegVal*> eval_args;
for (uint32_t i = 1; i < args.unnamed.size(); i++) {
auto intermediate = compile_error_guard(args.unnamed.at(i), env);
eval_args.push_back(intermediate->to_reg(env));
}
if (head_as_lambda) {
// inline the function!