Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!atha!aunro!alberta!arcsun.arc.ab.ca!zero!mdb From: mdb@zero.arc.ab.ca (Mark Brinsmead) Newsgroups: comp.lang.lisp Subject: Re: Hash-table saving Message-ID: <1991May5.190716.14922@arc.ab.ca> Date: 5 May 91 19:07:16 GMT References: <1991May03.092609.16721@kub.nl> <1991May3.134834.26515@hellgate.utah.edu> Sender: nobody@arc.ab.ca (Absolutely Nobody) Reply-To: mdb@zero.arc.ab.ca (Mark Brinsmead) Organization: Alberta Research Council Lines: 44 In article <1991May3.134834.26515@hellgate.utah.edu>, moore%defmacro.utah.edu@cs.utah.edu (Tim Moore) writes: |> In article pab@lucid.com (Peter Benson) writes: |> >There is a hack that works (I think) in lucid common lisp. |> >That is make a file with just |> > |> >(in-package :whatever) |> >(setq *hash-table* '#.*hash-table*) |> > |> >and then compile that file. |> >I don't know if this is required to work by CLtL. Any x3j13 people know if |> >this is clarified. |> |> One problem is that compiled constants are immutable, which means you |> couldn't (portably) add or delete any entries in the hash table when |> you loaded the file back in. |> There are *portable* ways to get around this. I have already "advertised" a CLOS-based package for saving common-lisp and CLOS objects by producing (sometimes large) source files which will re-create them. It is possible to preserve eq-ness throughout arbitrary structures, and to save (and restore) structures with arbitrary circularity. The package will save objects of almost any type (I still haven't figured out how to do defstruct's portably) including hash-tables, and CLOS instances. Its biggest problem is an occasional tendency to save *more* than you want it to! Unfortunately, I am still awaiting clearance to release the source code. When (if) I get it, the code will be released on comp.lang.clos. -- Mark Brinsmead Alberta Research Council Calgary Alberta Canada. email: mdb@arcsun.arc.ab.ca telephone: (403) 297-2600