Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!hplabs!hplntx!hplntx.hpl.hp.com!gjr
From: gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas)
Subject: Re: communicating with scheme (was Re: Removing READ)
Sender: news@hpl.hp.com (HPLabs Usenet Login)
Message-ID: <GJR.95Feb24164338@hplgr2.hpl.hp.com>
In-Reply-To: smcl@sytex.com's message of Thu, 23 Feb 1995 23:57:42 GMT
Date: Sat, 25 Feb 1995 00:43:38 GMT
Reply-To: gjr@hplabs.hpl.hp.com
References: <bakulD4Gyox.AtE@netcom.com> <V33Z1c2w165w@sytex.com>
Nntp-Posting-Host: hplgr2.hpl.hp.com
Organization: /users/gjr/.organization
Lines: 46

In article <V33Z1c2w165w@sytex.com> smcl@sytex.com (Scott McLoughlin) writes:

|   Howdy,
|	   OK. I'm convinced. Questions(suggestions?):
|   a] Linking symbols
|   b] Preserving object identity or maybe a broader
|   "similarity of constants" idea (from CL) for other
|   objects
|   c] Cyclic graphs (see [b])
|
|   None of these are killers, although moving on to CL
|   with it's property lists, DEFSTRUCT and DEFTYPE
|   facillities, etc. makes my hair stand on end.

MIT Scheme has a binary object dumper.  I believe other
implementations of Scheme/Lisp (e.g. T) do as well.
These can be used for transferring objects (not s-expressions) over a
connection of some sort.

MIT Scheme's dumper cannot dump everything, or more accurately, it
does not know how to load everything and the dumper prevents dumping
those things that cannot then be loaded.  In addition, it can only
load compiled code into the same architecture/configuration.

When an object is (fas)loaded, the symbols it contains are unified
with the symbols in the system, and non-pointer objects (e.g. fixnums,
#T, #F, '(), and some others) will still be EQ?, but nothing else will
be to anything that existed before the fasload operation.

A cyclic structure is dumped finitely, and will still be cyclic after
loading it, but will not necessarily share with other objects not
dumped as part of it.

In particular, in general

	(begin
          (fasdump object "file")
          (eq? object (fasload "file")))

will be #F.

MIT Scheme is happy to dump such objects over a network connection.
Unfortunately the format is machine-dependent and a pair of filter
programs (part of the distribution) have to be run if both peers
do not share architecture/configuration (e.g. big and little endian
versions of MIPS).
