[plt-scheme] serializing /all/ of struct

From: George Herson (gherson at snet.net)
Date: Mon Feb 12 10:22:09 EST 2007

How to serialize a structure to a file?

Read/tested using the info in
http://download.plt-scheme.org/doc/360/html/mzlib/mzlib-Z-H-39.html#node_chap_39
but so far can only deserialize a serialized structure
with its original field names if the program that
created the structure is still running.  A structure
inspector of (make-inspector) or #f isn't sufficient
to get my structure's field names written to file.

Let's say I have the following command and I want to
make dept persistent by writing /all/ its info to
file.  How do I change and add to it so that Scheme
will recognize later when this data is read and
deserialized?

(define-serialize-struct dept (deptid dname)
(make-inspector))

On a related subject, why was is advantageous to
create specially serializable objects rather than
enable (serialize any-object)?

thanks,
George


Posted on the users mailing list.