Wednesday, September 06, 2006

Serializable Gadgets

As Slava has noted, I've managed to get the serialization code to the point where it serializes user interface gadgets. To demonstrate it I serialized an in-progress game of Space Invaders, uploaded the serialized file to my web server and someone else on IRC downloaded it, deserialized it, and continued where the game left off.

Given the gadget on the stack, serialization to a file was as easy as:
[ 
"filename.ser" <file-writer> [
unparent serialize
] with-stream
] with-serialized

To get the instance running again:
[ 
"filename.ser" <file-writer> [
deserialize
] with-stream
] with-serialized "Space Invaders" open-titled-window


Categories:

2 Comments:

Blogger Slava Pestov said...

You have some unescaped HTML in there.

6:47 AM  
Blogger Chris Double said...

Damn, I'm always doing that. Thanks for letting me know! I think we should ban the less than sign from programming languages ;-)

10:47 AM  

Post a Comment

<< Home