MlValue::is_string added
This commit is contained in:
6
ml.cpp
6
ml.cpp
@@ -168,7 +168,7 @@ std::vector<std::string> MlValue::get_used_atoms() {
|
||||
}
|
||||
|
||||
// Is this a builtin function?
|
||||
bool MlValue::is_builtin() {
|
||||
bool MlValue::is_builtin() const {
|
||||
return type == BUILTIN;
|
||||
}
|
||||
|
||||
@@ -176,6 +176,10 @@ bool MlValue::is_number() const {
|
||||
return type == INT || type == FLOAT;
|
||||
}
|
||||
|
||||
bool MlValue::is_string() const {
|
||||
return type == STRING;
|
||||
}
|
||||
|
||||
// Get the "truthy" boolean value of this value.
|
||||
bool MlValue::as_bool() const {
|
||||
return type != NIL && *this != MlValue(0l); // TODO remove 0 as false
|
||||
|
||||
Reference in New Issue
Block a user