[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: print hash table to disk and reread in hash table
From: |
Ted Zlatanov |
Subject: |
Re: print hash table to disk and reread in hash table |
Date: |
Fri, 29 Aug 2008 13:10:11 -0500 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
The following message is a courtesy copy of an article
that has been posted to gnu.emacs.help as well.
On Fri, 29 Aug 2008 17:52:07 +0300 Eli Zaretskii <address@hidden> 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
- Re: print hash table to disk and reread in hash table,
Ted Zlatanov <=