From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Florian von Savigny Newsgroups: gmane.emacs.help Subject: Re: fastest data structure for a hash-like lookup Date: 05 Jun 2003 01:45:16 +0200 Organization: Linux Private Site Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <5lwug1h86f.fsf@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1054767707 6679 80.91.224.249 (4 Jun 2003 23:01:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 4 Jun 2003 23:01:47 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 05 01:01:45 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19NhGK-0001jX-00 for ; Thu, 05 Jun 2003 01:01:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19NhFX-0005eg-W2 for gnu-help-gnu-emacs@m.gmane.org; Wed, 04 Jun 2003 19:00:56 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!in.100proofnews.com!in.100proofnews.com!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 66 Original-NNTP-Posting-Host: pd9506f5a.dip0.t-ipconnect.de Original-X-Trace: online.de 1054767338 32760 217.80.111.90 (4 Jun 2003 22:55:38 GMT) Original-X-Complaints-To: abuse@einsundeins.com Original-NNTP-Posting-Date: Wed, 4 Jun 2003 22:55:38 +0000 (UTC) X-Newsreader: Gnus v5.7/Emacs 20.6 Original-Xref: shelby.stanford.edu gnu.emacs.help:114151 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10645 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10645 "Stefan Monnier" writes: > What do the keys look like ? Can you choose them freely ? They are strings, more precisely, attribute values (ID tokens) taken from SGML instances. > In elisp, it seems you could use a hash table of lisp lists, > vectors, or structures. See `defstruct' in the CL manual for > structure. CL means "common lisp"? > See `make-hash-table' in the elisp manual. That seems to be Emacs 21, which I'm trying to do without. > You mean it would be built once and for all and then stay constant. Yes, the code will even written by another program and imported by emacs via load-file. > > Sorry I wasn't able to find any useful documentation (the manual is as > > terse as ever). > > Which manual, what did you look for in it, what did you expect to find > and what did you find instead ? I tried to find advice on nested data structures in the chapters about Lisp data types, lists, and sequences, arrays and vectors. There is an example of a nested alist under copy-alist, but I tried to find the fastest such structure (and I doubted an alist was fast, since "keys" are not unique there). There was no hint in the section about vectors whether you could use them in such a way. After having played with Kevin's kind proposal, I realise chapter 7 about symbols is very relevant, but that's not where I thought to find anything. I'm not criticizing the manual in saying it is terse (condensed, more precisely). That makes it very clear when you try to find some detail you've forgotten. What I sometimes miss, though, is something with a "cookbook" approach: "I want to XY, how do I ...". It is hard for me to say what I "found instead", since I haven't tried to read in depth what apparently wouldn't help me further. It seems entirely possible to me if I knew more about the BASIC NOTIONS of Elisp, it would have been quite obvious that yes of course, why not, structure X and structure Y can be combined, thus, sections that seemed without a clue now would have been very helpful then. I suppose I'm not a serious programmer in this sense; I only try to learn things as far as I need them to produce something I can use (in other words, I'm the type who uses Perl...). Imitating also saves a lot of time compared to trying out. I don't know whether that answers your questions adequately. -- Florian v. Savigny If you are going to reply in private, please be patient, as I only check for mail something like once a week. - Si vous allez répondre personellement, patientez s.v.p., car je ne lis les courriels qu'environ une fois par semaine.