From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Hattuari Newsgroups: gmane.emacs.help Subject: Re: How to populate a property list? Date: Sat, 30 Oct 2004 08:05:58 -0400 Organization: Asii Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <2u78gpF279dr3U1@uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: sea.gmane.org 1099138340 1531 80.91.229.6 (30 Oct 2004 12:12:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Oct 2004 12:12:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 30 14:12:11 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CNs5a-0000Zd-00 for ; Sat, 30 Oct 2004 14:12:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CNsDU-0005Wj-CY for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Oct 2004 08:20:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Sat, 30 Oct 2004 07:08:09 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: KNode/0.8.1 Original-Lines: 36 Original-NNTP-Posting-Host: 66.92.149.152 Original-X-Trace: sv3-l4bzjo2uQcSw31MccAyEpzTrZ3vMVJx5oG9TbCno8xJKq4TZZwaLHAkpm+VNDBoA9R6Z6BvD/cizrlx!enDNtT2zChhSYsLjGrdgxEmreYVtuuSRuPGMNMW/T3TENU/515fBzfxu2EtNL1CRpNt/7VaKzKnL!PitM/rI2IDy5+s3G4as= Original-X-Complaints-To: abuse@speakeasy.net X-DMCA-Complaints-To: abuse@speakeasy.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.20 Original-Xref: shelby.stanford.edu gnu.emacs.help:126242 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 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 Xref: main.gmane.org gmane.emacs.help:21623 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21623 Kevin Rodgers wrote: > Hattuari wrote: > > Suppose I have a collection of key values pairs as follows: > > > > char c > > short s > > int i > > long l > > > > I want to put them in a property list. I can do this: > > Why a property list instead of an association list? > > (setq type-map > '((char . c) > (short . s) > (int . i) > (long . l))) > I didn't notice this message until just now. It must have taken the long way around to the server I read from. The aspect of a plist which fits my situation better is that a plist has unique keys. An alist can have multiple instances of the same key. Thus a plist maps more accurately to the logical structure of my data. I have to confess, I'm finding both alist and plist a bit awkward to work with. The alist isn't necessarily a Lisp list, and the plist isn't doesn't have some of the facilities I would like for accessing and manipulating the data. I suspect with time I will find reasonably concise means of expressing these operations. Lisp requires a different kind of thinking than other languages I've worked with. The closest language to Lisp that I have any significant experience with is Mathematica. -- p->m == (*p).m == p[0].m