Skip to content

Instantly share code, notes, and snippets.

@freeformz
Created November 28, 2011 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freeformz/1399051 to your computer and use it in GitHub Desktop.
Save freeformz/1399051 to your computer and use it in GitHub Desktop.
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