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: loading hash-table from a file? Date: Thu, 5 Jan 2012 14:16:41 +0900 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae9340f619f13d304b5c109b4 X-Trace: dough.gmane.org 1325740615 28622 80.91.229.12 (5 Jan 2012 05:16:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2012 05:16:55 +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 05 06:16:49 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 1Rifh2-00063V-Sn for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Jan 2012 06:16:49 +0100 Original-Received: from localhost ([::1]:42615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rifh1-0004j0-W3 for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Jan 2012 00:16:47 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:50479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rifgx-0004iq-BM for help-gnu-emacs@gnu.org; Thu, 05 Jan 2012 00:16:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rifgw-0002iE-Dw for help-gnu-emacs@gnu.org; Thu, 05 Jan 2012 00:16:43 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:60581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rifgw-0002i1-Aj for help-gnu-emacs@gnu.org; Thu, 05 Jan 2012 00:16:42 -0500 Original-Received: by iacb35 with SMTP id b35so399363iac.0 for ; Wed, 04 Jan 2012 21:16:41 -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=meZGKls4DyI0XtWL4r0/oiVf3v2kqdmTdnXMA70a1eg=; b=QZdSTDTHfNukD6Xj2Md9nm3XcQb+aQSrQuTkHMpPS9RX1rmiwImOpQPN7XlhBXYRJI oRQvZ5k9+T040zGmcWGO7U4TxbMlGhcguR5QG6ziCyrD/z2uz1oVItr2a6slqqKhKH7N VQm2CGi8fzqi5dQMwDryywbvSGvBm0ONv0WAM= Original-Received: by 10.50.41.131 with SMTP id f3mr1070135igl.28.1325740601578; Wed, 04 Jan 2012 21:16:41 -0800 (PST) Original-Received: by 10.43.131.138 with HTTP; Wed, 4 Jan 2012 21:16:41 -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:83338 Archived-At: --14dae9340f619f13d304b5c109b4 Content-Type: text/plain; charset=ISO-8859-1 I have never used hash-table of Emacs Lisp but I believe it's useful as a database. Say, I have a hundred key-value pairs, which are to be stored as hash-table. Can I save this as a (text?) file so that Emacs can load it when booting up? I am a little confused because if I use (cons key value), it outputs "(key . value)" which can be written in a regular file. If I wish to find the value from a key, all I need to do is to simply search through the file. Do you think I can save the database using hash-table like this? soichi --14dae9340f619f13d304b5c109b4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have never used hash-table of Emacs Lisp but I believe it's useful as= a database.

Say, I have a hundred key-value pairs, whic= h are to be stored as hash-table.=A0
Can I save this as a (text?)= file so that Emacs can load it when booting up?

I am a little confused because if I use (cons key value= ), it outputs "(key . value)" which can be written in a regular f= ile.
If I wish to find the value from a key, all I need to do is = to simply search through the file.

Do you think I can save the database using hash-table l= ike this?

soichi
--14dae9340f619f13d304b5c109b4--