This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Serializing closures
- To: Kawa Mailing List <kawa at sourceware dot cygnus dot com>
- Subject: Serializing closures
- From: balaban ittai <ittaib at cs dot bgu dot ac dot il>
- Date: Sun, 16 Apr 2000 05:06:50 +0300 (IDT)
Hi. A bit of a tough one... I'm trying to do something with
mobile agents which carry Scheme closures around with them. I've just
started making things mobile when I noticed that none of the kawa/gnu -
related classes are serializable. This, for the most part, is not a
problem, I think. All that is needed is adding
"implements java.io.Serializable" to some of the code, which I did.
However, the one irritating problem is this: class members of type
java.lang.reflect.Field are not serializable.
I thought of getting around this by overriding Java's default serializing
mechanism: When class Foo with a Field member x is serialized, x's
name and related Class object are stored. When class Foo is de-serialized,
x's Class and name are deserialized, and x is reconstructed from this
info.
My question is: Are there any foreseeable problems with this idea. Also,
which classes having Field members are needed at runtime, and for which
this scheme need be applied?
Thanks for any help. My use of Scheme in this project depends on this
fateful issue :)
Ittai