unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: help-gnu-emacs@gnu.org
Subject: Re: print hash table to disk and reread in hash table
Date: Fri, 29 Aug 2008 09:06:02 -0500	[thread overview]
Message-ID: <868wuflxv9.fsf@lifelogs.com> (raw)
In-Reply-To: mailman.17796.1219947087.18990.help-gnu-emacs@gnu.org

On Thu, 28 Aug 2008 21:10:56 +0300 Eli Zaretskii <eliz@gnu.org> wrote: 

>> From: Ted Zlatanov <tzz@lifelogs.com>
>> Date: Thu, 28 Aug 2008 09:03:53 -0500
>> 
>> If there's no library for serialization, it should definitely be
>> written.

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.  The spec format supports these types:

;; TYPE    ::= ( eval EXPR )		-- interpret result as TYPE
;;	    |  u8   | byte		-- length 1
;;          |  u16  | word | short      -- length 2, network byte order
;;          |  u24                      -- 3-byte value
;;          |  u32  | dword | long      -- length 4, network byte order
;;          |  u16r | u24r | u32r       -- little endian byte order.
;;	    |  str LEN                  -- LEN byte string
;;          |  strz LEN                 -- LEN byte (zero-terminated) string
;;          |  vec LEN [TYPE]           -- vector of LEN items of TYPE (default: u8)
;;          |  ip                       -- 4 byte vector
;;          |  bits LEN                 -- List with bits set in LEN bytes.

Is there some magic with `eval'?  I didn't get it.

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.  Transforming a hashtable to a list and
back is easy (even I can write it :)

Ted


  parent reply	other threads:[~2008-08-29 14:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28  1:01 print hash table to disk and reread in hash table Xah
2008-08-28  5:21 ` Thierry Volpiatto
     [not found] ` <mailman.17732.1219901096.18990.help-gnu-emacs@gnu.org>
2008-08-28  5:27   ` Xah
2008-08-28  6:17     ` Thierry Volpiatto
2008-08-28 14:03     ` Ted Zlatanov
2008-08-28 18:10       ` Eli Zaretskii
     [not found]       ` <mailman.17796.1219947087.18990.help-gnu-emacs@gnu.org>
2008-08-29 14:06         ` Ted Zlatanov [this message]
2008-08-29 14:52           ` Eli Zaretskii
     [not found]           ` <mailman.17897.1220021571.18990.help-gnu-emacs@gnu.org>
2008-08-29 18:10             ` Ted Zlatanov
2008-08-28  8:36 ` Niels Giesen
2008-10-10 20:38 ` harven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=868wuflxv9.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).