Skip to content

Instantly share code, notes, and snippets.

@hashmal
Created March 1, 2014 23:22
Show Gist options
  • Save hashmal/9299195 to your computer and use it in GitHub Desktop.
Save hashmal/9299195 to your computer and use it in GitHub Desktop.
Add message serialization support to Io (might be useful to pass messages to other processes or even over a network)
Message justSerialized := method(stream,
stream write(name)
if(arguments size > 0,
stream write("(")
stream write(arguments map(serialized) join(", "))
stream write(")")
)
if (next,
if (next isEndOfLine not, stream write(" "))
stream write(next serialized)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment