[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: print hash table to disk and reread in hash table
From: |
Niels Giesen |
Subject: |
Re: print hash table to disk and reread in hash table |
Date: |
Thu, 28 Aug 2008 10:36:51 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Xah <xahlee@gmail.com> writes:
> if i have a hash table in elisp, is there a way to save it to disk and
> reread in when starting emacs?
>
> Thanks.
>
> Xah
> ∑ http://xahlee.org/
>
> ☄
You might use this code (I use it in gimp-mode):
(defmacro gimp-hash-to-list (hash-table)
(let ((nl (gensym)))
`(let (,nl)
(maphash (lambda (k v)
(push (list k v) ,nl)) ,hash-table)
,nl)))
(defmacro gimp-list-to-hash (list)
(let ((ht (gensym)))
`(let ((,ht (make-hash-table)))
(mapc (lambda (item)
(puthash (car item) (cadr item) ,ht)) ,list)
,ht)))
- print hash table to disk and reread in hash table, Xah, 2008/08/27
- Re: print hash table to disk and reread in hash table, Thierry Volpiatto, 2008/08/28
- Message not available
- Re: print hash table to disk and reread in hash table, Xah, 2008/08/28
- Re: print hash table to disk and reread in hash table, Thierry Volpiatto, 2008/08/28
- Re: print hash table to disk and reread in hash table, Ted Zlatanov, 2008/08/28
- Re: print hash table to disk and reread in hash table, Eli Zaretskii, 2008/08/28
- Message not available
- Re: print hash table to disk and reread in hash table, Ted Zlatanov, 2008/08/29
- Re: print hash table to disk and reread in hash table, Eli Zaretskii, 2008/08/29
- Message not available
- Re: print hash table to disk and reread in hash table, Ted Zlatanov, 2008/08/29
Re: print hash table to disk and reread in hash table,
Niels Giesen <=