include env fix, decode-universal-time added

This commit is contained in:
2022-02-08 08:08:47 +01:00
parent 3ca189a78c
commit 0260c74e7f
4 changed files with 4 additions and 10 deletions

6
ml.cpp
View File

@@ -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;
}