Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bcm!dimacs.rutgers.edu!aramis.rutgers.edu!atanasoff.rutgers.edu!lou From: lou@cs.rutgers.edu (lou) Newsgroups: comp.lang.lisp Subject: Re: Structure question Message-ID: Date: 25 Jan 91 18:46:32 GMT References: <1991Jan25.115153.2864@kub.nl> Sender: lou@atanasoff.rutgers.edu Reply-To: lou@cs.rutgers.edu Organization: Computer Science Dept., Rutgers University, New Brunswick, NJ 08903 Lines: 29 In-reply-to: pberck@kub.nl's message of 25 Jan 91 11:51:53 GMT To: pberck@kub.nl Peter Berck writes: I have this structure which I save and load from disc. I recently added a :print-function to it, but now (after I printed it to disc) I can't read it back in again There are two solutions to this problem: 1) Revise your print function so that under some circumstance it prints the structure in the #S( ... ) form. E.g. it might check the global variable *print-pretty*, and if it is NIL print the #S form. Then just make sure that you are not pretty-printing when you dump your network to disk. Off hand, though, I do not know of any clean and portable way to both have your own print-function and at the same time get access to the print code that would be used if you did not have one. So, you probably have to write your own code to print the #S form (or find a non-portable method that works in your implementation of CL). 2) Revise your print function to start with some special character or character sequence and write a read-macro for that character or sequence that reads in your new printed format for the structures. -- Lou Steinberg uucp: {pretty much any major site}!rutgers!aramis.rutgers.edu!lou internet: lou@cs.rutgers.edu