Created
October 27, 2013 08:34
-
-
Save LectomT/7179201 to your computer and use it in GitHub Desktop.
Devon 2013 대안언어 축제 Quiz.io 문제는: https://gist.github.com/dahlia/e7ebd78da2ce363af308
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number json := method(self asString) | |
true json := method(self asString) | |
false json := method(self asString) | |
nil json := method("null") | |
Sequence json := method("\"" .. self asMutable replaceSeq("\\", "\\\\") replaceSeq("\"", "\\\"") .. "\"") | |
List json := method("[" .. self map(a, a json) join(",") .. "]") | |
Map json := method( | |
"{" .. self map(k, v, k json .. ":" .. v json) join(",") .. "}" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
고생하신 유은총님 및 신원미상 (죄송합니다. 성함을 모르겠...)님께 감사드리며.
이스케이프 예외설정은 뭔가 더 필요할것 같지만 일단 패스... -0-