Instead of using Io's `asJson` method which escapes forward slashes,
implement our own string escaping code so it fits the Mal requirements.
The relevant step1 test was modified from soft to hard.
// Io strings are of type Sequence
Sequence malPrint := method(readable,
- if(readable, self asString asJson, self asString)
+ if(readable,
+ "\"" .. (self asString asMutable replaceSeq("\\", "\\\\") replaceSeq("\"", "\\\"") replaceSeq("\n", "\\n")) .. "\"",
+ self asString)
)
MalMeta := Object clone do(
;=>","
"-"
;=>"-"
+"/"
+;=>"/"
":"
;=>":"
";"
;; fantom fails this one
"!"
;=>"!"
-;; io fails this one
-"/"
-;=>"/"