Skip to content

Instantly share code, notes, and snippets.

@freeformz
Created Nov 28, 2011
Embed
What would you like to do?
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
> 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