Created
March 1, 2014 23:22
-
-
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)
This file contains hidden or 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
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