help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loading hash-table from a file?


From: ishi soichi
Subject: Re: loading hash-table from a file?
Date: Thu, 5 Jan 2012 18:13:15 +0900

Thanks everyone. I think I works well!

soichi

2012/1/5 Teemu Likonen <address@hidden>
* 2012-01-05T10:35:18+02:00 * Valentin Baciu wrote:

> In my Emacs 24, I can read back a printed (simple) hash table. I am
> not sure weather using more complex data types as values will also
> work.
>
> ;; Writing the hash table to a "database" file
>
> (with-current-buffer (find-file-noselect "/tmp/x")
>   (let ((h (make-hash-table)))
>     (puthash 'a 0 h)
>     (puthash 'b 1 h)
>     (insert (format "%s" h))
>     (save-buffer)))

Use the %S format character to print objects in machine-readable (i.e.,
READ) format.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]