From: Timothy Yi
Subject: saving lisp object into a file
Date: 
Message-ID: <DtwKov.AJv@murdoch.acc.Virginia.EDU>
I have a folling object to save, and read later on.

(setf a '((1 2) (1 3) (2 3)) )
(setf b '((2 3) (2 5) (3 5)) )
(setf c (make-array 2) )
(setf (aref c 0) a)
(setf (aref c 1) b)

i would like to save "c" into a file. but all i could save was
#<Simple-Vector T 2 A4098E>

btw, i am using sun common lisp 4.0
anyone can help me?

-tim

····@virginia.edu

From: Marco Antoniotti
Subject: Re: saving lisp object into a file
Date: 
Message-ID: <s0891d2urrg.fsf@salmon.ICSI.Berkeley.EDU>
There is also a quite complex 'save-object' package in the
AI.Repository.

-- 
Marco Antoniotti - Resistente Umano
===============================================================================
International Computer Science Institute	| ·······@icsi.berkeley.edu
1947 Center STR, Suite 600			| tel. +1 (510) 643 9153
Berkeley, CA, 94704-1198, USA			|      +1 (510) 642 4274 x149
===============================================================================
	...it is simplicity that is difficult to make.
	...e` la semplicita` che e` difficile a farsi.
				Bertholdt Brecht
From: Stefan Bamberger
Subject: Re: saving lisp object into a file
Date: 
Message-ID: <bambi-0207960939470001@wi6a84.informatik.uni-wuerzburg.de>
In article <··········@murdoch.acc.Virginia.EDU>,
····@pearson.stat.Virginia.EDU (Timothy Yi) wrote:


-Write something like the following in a file:
(setq c #.c)

-Compile the file while you have c bound to value you want to save
-Load the compiled file whenever you want, the values are back
-note: with self-defined types (i.e. clos objects) you need own
       make-load-form methods (s. CLtL2) to get them saved
-fast but not portable :-))
- stefan

> I have a folling object to save, and read later on.
> 
> (setf a '((1 2) (1 3) (2 3)) )
> (setf b '((2 3) (2 5) (3 5)) )
> (setf c (make-array 2) )
> (setf (aref c 0) a)
> (setf (aref c 1) b)
> 
> i would like to save "c" into a file. but all i could save was
> #<Simple-Vector T 2 A4098E>
> 
> btw, i am using sun common lisp 4.0
> anyone can help me?
> 
> -tim
> 
> ····@virginia.edu
From: Erik Naggum
Subject: Re: saving lisp object into a file
Date: 
Message-ID: <3045304265121858@arcana.naggum.no>
[Timothy Yi]

|   I have a folling object to save, and read later on.
|   
|   (setf a '((1 2) (1 3) (2 3)) )
|   (setf b '((2 3) (2 5) (3 5)) )
|   (setf c (make-array 2) )
|   (setf (aref c 0) a)
|   (setf (aref c 1) b)
|   
|   i would like to save "c" into a file. but all i could save was
|   #<Simple-Vector T 2 A4098E>

this happens when *PRINT-ARRAY* is nil.  set or bind it to T, and you will
obtain a readable form as in:

    #(((1 2) (1 3) (2 3)) ((2 3) (2 5) (3 5)))

the `write' function has a keyword argument :array that control this.  it
defaults to the the value of *PRINT-ARRAY*.