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:
To get the instance running again:
Categories: factor
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: factor

2 Comments:
You have some unescaped HTML in there.
Damn, I'm always doing that. Thanks for letting me know! I think we should ban the less than sign from programming languages ;-)
Post a Comment
<< Home