> > I wonder if there is a standard serialization method exists for Lisp
> > objects. I though that `write' was doing the job but actually it only
> > writes the printable representation of an object to a stream. For
> > example, how can I serialize an hashtable? Does I call `maphash' to
> > write all entries or there is another method (which I assume, will be
> > specific to each Lisp implementations).
>
> No such thing as a standard serialization method in Lisp. The problem is
> that only you as a programmer can know how your own data structures
> should be replicated: deep copy or shallow copy, what to do with shared
> structure etc. This reduces down to what is meant by two objects being
> equal in your system.
> Take a look at URL: http://world.std.com/%7Epitman/PS/EQUAL.html
> for a more detailed view at the matter.
Ok, thanx for your answers. I though an auto (or default) mechanism was
available, but I was wrong. Anyway, my main concern is to be able to
serialize objects through a socket stream to implement a basic RPC
system. I think that it won't be a pain to serialize any object by hand.
Afterall, any structure can be tranformed to a set of lists and then
written to a stream.
"Frederic Brunel" <······@mail.dotcom.fr> writes:
> Ok, thanx for your answers. I though an auto (or default) mechanism
> was available, but I was wrong. Anyway, my main concern is to be
> able to serialize objects through a socket stream to implement a
> basic RPC system. I think that it won't be a pain to serialize any
> object by hand. Afterall, any structure can be tranformed to a set
> of lists and then written to a stream.
Keene's book on CLOS documents a scheme for doing exactly this; well
worth looking at.
--
(concatenate 'string "aa454" ·@freenet.carleton.ca")
http://www3.sympatico.ca/cbbrowne/sgml.html
Rules of the Evil Overlord #3. "My noble half-brother whose throne I
usurped will be killed, not kept anonymously imprisoned in a forgotten
cell of my dungeon." <http://www.eviloverlord.com/>