From 990d75cf7a9c6accd6d88ac9f51f21bc40d67bcf Mon Sep 17 00:00:00 2001 From: vaclavt Date: Mon, 10 Jan 2022 20:25:57 +0100 Subject: [PATCH] true and nil can be casted to string now --- ml.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ml.cpp b/ml.cpp index 599d6d5..827f5b7 100644 --- a/ml.cpp +++ b/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); }