tiny beautification
This commit is contained in:
10
ml.cpp
10
ml.cpp
@@ -15,7 +15,6 @@
|
||||
#include <sstream>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <ctime>
|
||||
|
||||
|
||||
@@ -47,7 +46,7 @@
|
||||
|
||||
|
||||
|
||||
// Convert an object to a string using a stringstream conveniently
|
||||
// Convert an object to a string using a string stream conveniently
|
||||
#define to_string(x) static_cast<std::ostringstream>((std::ostringstream() << std::dec << x )).str()
|
||||
|
||||
// Replace a substring with a replacement string in a source string
|
||||
@@ -1350,8 +1349,8 @@ namespace builtin {
|
||||
eval_args(args, env);
|
||||
|
||||
if (args.size() != 1)
|
||||
throw MlError(MlValue(FLOAT_TYPE, cast_to_float), env,
|
||||
args.size() > 1 ? TOO_MANY_ARGS : TOO_FEW_ARGS);
|
||||
throw MlError(MlValue(FLOAT_TYPE, cast_to_float), env, args.size() > 1 ? TOO_MANY_ARGS : TOO_FEW_ARGS);
|
||||
|
||||
return args[0].cast_to_float();
|
||||
}
|
||||
|
||||
@@ -1360,7 +1359,8 @@ namespace builtin {
|
||||
eval_args(args, env);
|
||||
|
||||
if (args.size() != 1)
|
||||
throw MlError(MlValue(INT_TYPE, cast_to_int), env, args.size() > 1 ? TOO_MANY_ARGS : TOO_FEW_ARGS);
|
||||
throw MlError(MlValue(INT_TYPE, cast_to_int), env, args.size() > 1 ? TOO_MANY_ARGS : TOO_FEW_ARGS);
|
||||
|
||||
return args[0].cast_to_int();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user