true and nil can be casted to string now
This commit is contained in:
4
ml.cpp
4
ml.cpp
@@ -287,6 +287,10 @@ MlValue MlValue::cast_to_string() const {
|
||||
return MlValue::string(std::to_string(stack_data.f));
|
||||
case STRING:
|
||||
return *this;
|
||||
case TRUE:
|
||||
return MlValue::string("#t");
|
||||
case NIL:
|
||||
return MlValue::string("nil");
|
||||
default:
|
||||
throw MlError(*this, MlEnvironment(), BAD_CAST_STRING);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user