Article View: comp.lang.clos
Article #483Re: saving instances on file
From: Mark Brinsmead
Date: Mon, 08 Apr 1991 19:49
Date: Mon, 08 Apr 1991 19:49
49 lines
2820 bytes
2820 bytes
In article <gc0_Ia600iQ5E_z0Q=@andrew.cmu.edu>, mh5l+@ANDREW.CMU.EDU
("Mohammed M. Hakim") writes:
|> I am currently working on developing a system that will require the user
|> to save the instances he/she created on top of a pre-defined classes.
|> Does any one know of any utility in the public domain that can be used
|> to keep track of the instances created and later parse them on a file
|> for future use?
|> I would appreciate any suggestions regarding the best way to do such
|> task. Do I really need to keep track of every instance made and then
|> later on parse a clos code to a file that reads like:
|> (make-instance ...
|> (make-instance ...
|> ..
|> for future use. Or is there anyway around this?
|>
|> Maher Hakim
|> mh5L@andrew.cmu.edu
It just so happens that I *do* have such an animal. It is basically
a set of methods which will traverse an arbitrary tree of LISP/CLOS
structures (including instances, hash-tables, arrays, strings, symbols,
and numbers) and save them to a file in the form of lisp source code
which, when executed, will re-create the structure(s) fully preserving
EQ'ness throughout the hierarchy.
It works (should work) for circular structures, and should be portable
to almost any common lisp using an up-to-date version of PCL. Because it
is based on PCL, there is no support for saving instances of structures
defined with defstruct. The code has been used (a bit) and should work,
but comes without any sort of warrantee or promises, WHATSOEVER.
The only hitch is that I'm not sure whether I am allowed to release
this code to the public. I shall begin investigating that issue now;
in the meantime, anyone interested in getting a copy should e-mail me
so I can decide whether there is sufficient interest to justify posting
this to the net. (Assuming, of course, that I am allowed to!)
In the worst case, I can probably make the *design* available. That
ought to give you enough information to build one of these beasties
yourself.
-- Mark Brinsmead,
Advanced Computing and Engineering Department,
Alberta Research Council.
internet: mdb@arcsun.arc.ab.ca --or-- mdb@[128.144.1.3]
telephone: (403) 297-2600
Technical Details
Message-ID:
<1991Apr8.194957.25531@arc.ab.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!rutgers!mit-eddie!uw-beaver!ubc-cs!alberta!arcsun.arc.ab.ca!zero!mdbReferences:
<gc0_Ia600iQ5E_z0Q=@andrew.cmu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!rutgers!mit-eddie!uw-beaver!ubc-cs!alberta!arcsun.arc.ab.ca!zero!mdb From: mdb@zero.arc.ab.ca (Mark Brinsmead) Newsgroups: comp.lang.clos Subject: Re: saving instances on file Message-ID: <1991Apr8.194957.25531@arc.ab.ca> Date: 8 Apr 91 19:49:57 GMT References: <gc0_Ia600iQ5E_z0Q=@andrew.cmu.edu> Sender: nobody@arc.ab.ca (Absolutely Nobody) Reply-To: mdb@zero.arc.ab.ca (Mark Brinsmead) Distribution: inet Organization: Alberta Research Council Lines: 49