include env fix, decode-universal-time added
This commit is contained in:
6
ml.cpp
6
ml.cpp
@@ -1393,16 +1393,12 @@ MlValue tcp_client(std::vector<MlValue> args, MlEnvironment &env) {
|
||||
|
||||
// Read a file and execute its code
|
||||
MlValue include(std::vector<MlValue> args, MlEnvironment &env) {
|
||||
// Import is technically not a special form, it's more of a macro.
|
||||
// We can evaluate our arguments.
|
||||
eval_args(args, env);
|
||||
|
||||
if (args.size() != 1)
|
||||
throw MlError(MlValue("include", include), env, args.size() > 1 ? TOO_MANY_ARGS : TOO_FEW_ARGS);
|
||||
|
||||
MlEnvironment e;
|
||||
MlValue result = run(read_file_contents(args[0].as_string()), e);
|
||||
env.combine(e);
|
||||
MlValue result = run(read_file_contents(args[0].as_string()), env);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user