From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phillip Lord Newsgroups: gmane.emacs.help Subject: Re: Package for data serialization? Date: Tue, 13 Jun 2006 17:02:11 +0100 Organization: University of Newcastle upon Tyne Message-ID: References: <1150195170.157848.7260@f6g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150216835 11464 80.91.229.2 (13 Jun 2006 16:40:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Jun 2006 16:40:35 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 13 18:40:34 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FqBwH-0004G7-80 for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Jun 2006 18:40:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqBwG-0007VA-Ok for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Jun 2006 12:40:24 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!feed1.jnfs.ja.net!feed2.jnfs.ja.net!jnfs.ja.net!news.ncl.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: dinley.ncl.ac.uk Original-X-Trace: ucsnew1.ncl.ac.uk 1150214531 21740 128.240.150.78 (13 Jun 2006 16:02:11 GMT) Original-X-Complaints-To: abuse@newcastle.ac.uk Original-NNTP-Posting-Date: Tue, 13 Jun 2006 16:02:11 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:YXSetuS9mu6iVG9alp3ds5KhdIo= Original-Xref: shelby.stanford.edu gnu.emacs.help:139805 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35429 Archived-At: >>>>> "anon" == spamfilteraccount writes: anon> Is there a package for de/serializing an arbitrary elisp data anon> structure, so that it can be read/written in binary format anon> from/to disk? anon> I know about prin1 and co., but they create a printed anon> representation and I want binary for speed and size. As far as I know, this doesn't work in general. Not all lisp objects have an output representation that can then by eval'd back in; the most obvious one for me is the hash-table which is a pain. I can understand why objects such as a frame or a window can't be serialised, but not a hash. However, as far as I can tell Emacs does the have the ability to store arbitrary elisp data items -- this is what `dump-emacs' does for example. I wonder how hard it would be to extend this system so that it could cope with arbitrary bits of the current state. It would be quite useful. Incidentally, the printed representation is not bad. Emacs is pretty quick at parsing lisp code, even large data structures, for purposes of an eval. Cheers Phil