do not suppose in eval that list first element is function
This commit is contained in:
parent
5ca8f64853
commit
358414d7d3
24
ml.cpp
24
ml.cpp
|
|
@ -729,20 +729,20 @@ MlValue MlValue::eval(MlEnvironment &env) {
|
|||
|
||||
args = std::vector<MlValue>(list.begin() + 1, list.end());
|
||||
|
||||
// Only evaluate our arguments if it's not builtin!
|
||||
// Builtin functions can be special forms, so we
|
||||
// leave them to evaluate their arguments.
|
||||
function = list[0].eval(env);
|
||||
if (function.type == BUILTIN || function.type == LAMBDA) {
|
||||
// Only evaluate our arguments if it's not builtin!
|
||||
// Builtin functions can be special forms, so we
|
||||
// leave them to evaluate their arguments.
|
||||
if (!function.is_builtin())
|
||||
for (size_t i = 0; i < args.size(); i++)
|
||||
args[i] = args[i].eval(env);
|
||||
|
||||
if (!function.is_builtin())
|
||||
for (size_t i = 0; i < args.size(); i++)
|
||||
args[i] = args[i].eval(env);
|
||||
|
||||
MlPerfMon::instance().add_method_call(function.type == LAMBDA ? "lambda" : function.str);
|
||||
res = function.apply( args, env );
|
||||
MlPerfMon::instance().end_method_call();
|
||||
|
||||
return res;
|
||||
MlPerfMon::instance().add_method_call(function.type == LAMBDA ? "lambda" : function.str);
|
||||
res = function.apply(args, env);
|
||||
MlPerfMon::instance().end_method_call();
|
||||
return res;
|
||||
}
|
||||
|
||||
default:
|
||||
return *this;
|
||||
|
|
|
|||
Loading…
Reference in New Issue