From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.help,gmane.emacs.devel Subject: Re: print hash table to disk and reread in hash table Date: Fri, 29 Aug 2008 13:10:11 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <863aknitfg.fsf@lifelogs.com> References: <34f9604c-a23b-4ad9-9c84-f45884a6df23@x16g2000prn.googlegroups.com> <86od3dfd86.fsf@lifelogs.com> <868wuflxv9.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220035256 4195 80.91.229.12 (29 Aug 2008 18:40:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Aug 2008 18:40:56 +0000 (UTC) Cc: Emacs Development To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 29 20:41:51 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KZ8ui-0006E0-LP for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Aug 2008 20:41:40 +0200 Original-Received: from localhost ([127.0.0.1]:42254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZ8tk-0004kM-2r for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Aug 2008 14:40:40 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newsfeed.straub-nv.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-X-Trace: news.albasani.net 4wvc7I+zV8yk4gqCzC+8+twnkc5MVl86VwrOlDsZQNbs5UDF3bu9lBsLAtuNa7/UnxXfx+mUFnHbImPP8Cv/e0L5CrWjCBK1Q2gTBkEs3f0/Bxf5Q1JyK2n+DhpPpafx Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Fri, 29 Aug 2008 18:10:11 +0000 (UTC) X-User-ID: KC5Bb06/JSwB+W34+jYhVfTYOEHqv6Xv90h6/BLEgvQ= X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Cancel-Lock: sha1:shsjPhb7xwcRmfgIiLJuxz8OZTc= sha1:wz1Pr/0db3+hZBxLc7UafVcGgXE= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) X-NNTP-Posting-Host: F2e2ZP3j0Lj2uf6mTMgI5SX2hkfVwrn9inkTVfLpGFM= Original-Xref: news.stanford.edu gnu.emacs.help:161769 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:57111 gmane.emacs.devel:103196 Archived-At: On Fri, 29 Aug 2008 17:52:07 +0300 Eli Zaretskii wrote: EZ> You mean, like bindat.el? >> >> That looks useful for binary data. I don't see from the code how to use >> it to save and load a hashtable. EZ> I never used it, I just advertised the closest hit for what you seemed EZ> to be looking. >> In addition, this library doesn't manage file I/O. I'd expect the >> library do do content coding and error handling internally. This is, >> actually, the most tedious part. EZ> A cause for a small project, I guess. ;-) I can just copy the code out of gnus-registry.el and abstract the functionality to do a first cut of such a library. For a large hashtable, though, converting to a list on the way in and out is inefficient compared to storing it in a more "native" format. Is there such a format, comparable to the native list read-eval format, as seen in gnus-load: (with-temp-buffer (insert-file-contents file) (while (not (eobp)) (condition-case type (let ((form (read (current-buffer)))) (eval form)) ;; ... much code omitted ... cc to emacs-devel as I think this is of interest to that list. Thanks Ted