From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ishi soichi Newsgroups: gmane.emacs.help Subject: error "Odd number of elements in hashtable data Date: Thu, 12 Jan 2012 11:50:34 +0900 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f2343dfed599604b64bcf08 X-Trace: dough.gmane.org 1326336646 30511 80.91.229.12 (12 Jan 2012 02:50:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Jan 2012 02:50:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 12 03:50:43 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RlAkU-0003lp-8B for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Jan 2012 03:50:42 +0100 Original-Received: from localhost ([::1]:49340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlAkT-0008Ro-Cs for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 21:50:41 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlAkO-0008Rh-9Z for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 21:50:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlAkN-0000Wj-BO for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 21:50:36 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:40454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlAkN-0000Wb-8D for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 21:50:35 -0500 Original-Received: by iafj26 with SMTP id j26so2389911iaf.0 for ; Wed, 11 Jan 2012 18:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=m+8Z2W0DHQHYWc0/sc4kC4Lla94vUmf7UFI5v0AILOQ=; b=pnua0j6xoHw0UE5m4DgRUU0HXgIr7Lrr48ibHeUZJxWBMj/ZHnxvnxofXGP7y9jZRn cqTRxD4hT+RHEzKs0ufAM5PT7lc/6AFKH8LE4VRd5x9wtHt/XTSgmRQYoSYH8RHGf20w i2bOk7l7VZ4mqnuUKA8z4ATDDBkRsTgpvSRDs= Original-Received: by 10.50.104.163 with SMTP id gf3mr5461167igb.26.1326336634083; Wed, 11 Jan 2012 18:50:34 -0800 (PST) Original-Received: by 10.42.229.71 with HTTP; Wed, 11 Jan 2012 18:50:34 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83471 Archived-At: --e89a8f2343dfed599604b64bcf08 Content-Type: text/plain; charset=ISO-8859-1 I'm trying to develop a database using hash-table. As you can see, creating a file that contains the data of hash-table. (setq data-directory "~/(path)/hashtest") (with-current-buffer (find-file-noselect data-directory) (let ((h (make-hash-table :test 'equal))) (puthash "think" "hard" h) (puthash "go" "this" h) (puthash "come" "that" h) (puthash "went" "gone" h) (puthash "category" "bad" h) (puthash "why" "how" h) (puthash "what" "on" h) (insert (format "%S" h)) (save-buffer))) in the "hashtest" file, #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ("think" "hard" "go" "this" "come" "that" "went" "gone" "category" "bad" "why" "how" "what" "on" ...)) But for checking, (with-current-buffer (find-file-noselect data-directory) (let ((ht (read (current-buffer)))) (gethash "go" ht))) gives an error, Debugger entered--Lisp error: (error "Odd number of elements in hashtable data")... "Odd number" does not make sense to me at all. Could anyone help me out? Thanks in advance! soichi --e89a8f2343dfed599604b64bcf08 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I'm trying to develop a database using hash-table.
As yo= u can see, creating a file that contains the data of hash-table.
=
(setq data-directory "~/(path)/hashtest")
(with-current-buffer (find-file-noselect data-directory)
=A0= (let ((h (make-hash-table :test 'equal)))
=A0 =A0 (puthash &= quot;think" "hard" h)
=A0 =A0 (puthash "go&qu= ot; "this" h)
=A0 =A0 (puthash "come" "that" h)
=A0 = =A0 (puthash "went" "gone" h)
=A0 =A0 (puthas= h "category" "bad" h)
=A0 =A0 (puthash "= why" "how" h)
=A0 =A0 (puthash "what" "on" h)
=A0 =A0 = (insert (format "%S" h))
=A0 =A0 (save-buffer)))
<= div>
in the "hashtest" file,=A0

#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8= data ("think" "hard" "go" "this" &= quot;come" "that" "went" "gone" "ca= tegory" "bad" "why" "how" "what&quo= t; "on" ...))

But for checking,

(with-c= urrent-buffer
=A0 =A0 (find-file-noselect data-directory)
=A0 (let ((ht (read (current-buffer))))
=A0 =A0 (gethash "= ;go" ht)))

gives an error,=A0

Debug= ger entered--Lisp error: (error "Odd number of elements in hashtable d= ata")...

"Odd number" does not make= sense to me at all.
Could anyone help me out?

Thanks in advance!<= /div>

soichi
--e89a8f2343dfed599604b64bcf08--