true and nil can be casted to string now
This commit is contained in:
parent
d275be643c
commit
990d75cf7a
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue