Created
November 28, 2011 04:06
-
-
Save freeformz/1399051 to your computer and use it in GitHub Desktop.
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
OperatorTable addAssignOperator(":", "atPutNumber") | |
curlyBrackets := method( | |
r := Map clone | |
call message arguments foreach(arg, | |
r doMessage(arg) | |
) | |
r | |
) | |
Map atPutNumber := method( | |
self atPut( | |
call evalArgAt(0) asMutable removePrefix("\"") removeSuffix("\""), | |
call evalArgAt(1)) | |
) | |
pn := doString("{ \"Ed Muller\": \"555-555-1212\" }") | |
pn keys println | |
pn values println |
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
> io dsl1.io | |
list(Ed Muller) | |
list(555-555-1212) | |
^^ works | |
via the repl \/ it doesn't. I get... | |
pn := doString("{ \"Ed Muller\": \"555-555-1212\" }") | |
Exception: Map does not respond to 'call' | |
--------- | |
Map call Command Line 1 | |
Object curlyBrackets doString 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment