From: Glen A. Reece
Subject: RE: save-object problem
Date: 
Message-ID: <1993Sep7.102722.15456@aisb.ed.ac.uk>
From: ·····@mod-serv.dfki.uni-sb.de (Thomas Trenz)
Date: 6 Sep 1993 15:13:28 GMT

  I'm working with Allegro Common Lisp 4.1 on a Sun.

  I would like to save a complex structure to disk. In the FAQ there are two
  different ways to do this. The first one works as follows:

  create a file containing just the lines
        (in-package "YOUR-PACKAGE")
        (setq *hash-table* '#.*hash-table*)
  and compile it.

  This version works, but for large structures this is too slow. So I thought
  that I could use Kerry Koitzsch's save-object library. The original one 
  doesn't seem to be adapted to Allegro Lisp. I couldn't even load the
  lisp-source without an error. But I found a file called save-object-7o.lisp.
  They say that this version should run on Allegro Lisp 4.1. This version can
  be loaded without an error and I can save simple structures not containing
  hash-tables.
  
  But I can't load them via (load "filename").
  So can anybody tell me wether there is a version of save-object adapted to
  Allegro common lisp.

  Other suggestions are welcome too.

********************************************************************

  Thomas,

  I tried save-object-7o.lisp with Lucid 4.1 and had some minor successes.
  I was using it to save CLOS objects (not hash-tables) and it worked
  fine for the save-one-retrieve-one object case.  If you're only saving
  one object then (save-object object "filename") works.  You can obviously
  tell this by looking at the file it creates.  To retrieve it you use
  (load "filename") which then binds the variable *db-input* in the
  :DATABASE package provided in save-object-7o.lisp.  You then put
  *db-input* in some other variable or structure and that's it (e.g.,
  (setf (gethash 'the-object *a-hash-table*) *db-input*)).

  The problem I had was that I couldn't get with-saved-objects to actually
  write anything to a file...I didn't get an error, but nothing was in
  the file it created.

  Hope this helps,
    - Glen
--
Glen A. Reece, Ph.D. Student               | Dept. of Artificial Intelligence
INTERNET: ··········@ed.ac.uk              | 80 South Bridge, E17
     or : ·······@ed.ac.uk                 | University of Edinburgh
phone: 031-650-2712                        | Edinburgh EH1 1HN.  Scotland