From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Denis Bueno Newsgroups: gmane.emacs.help Subject: Re: Structured data in Emacs Lisp Date: Tue, 26 Apr 2005 11:28:48 -0400 Message-ID: <6dbd4d0005042608284f545f6d@mail.gmail.com> References: Reply-To: Denis Bueno NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1114529189 2044 80.91.229.2 (26 Apr 2005 15:26:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2005 15:26:29 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 26 17:26:27 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DQRw4-00082a-Rq for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 17:25:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQS1p-0003R9-0f for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 11:31:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQS17-00035u-U5 for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 11:30:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQS16-00035C-3f for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 11:30:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQS15-0002ue-VN for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 11:30:28 -0400 Original-Received: from [64.233.184.197] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQS3C-00050x-KK for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 11:32:38 -0400 Original-Received: by wproxy.gmail.com with SMTP id 36so2027372wra for ; Tue, 26 Apr 2005 08:28:48 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AmT3oa1kY4Wv0TreiBlkdnZmWFXd0Xre1QYYj0scp7JAI4oJFyNe6bjd1nVZZWn8HmtUKrpiBV0mWGwUyHMVq08zGX2FHgEU1w3TgGpx8slqF0GQ3ivqj4faFZKsszeUmHXGYmd5wjM9kq0L5wN9HbIZm/4YQ8doG5EiyXvEJcY= Original-Received: by 10.54.49.34 with SMTP id w34mr2603918wrw; Tue, 26 Apr 2005 08:28:48 -0700 (PDT) Original-Received: by 10.54.43.7 with HTTP; Tue, 26 Apr 2005 08:28:48 -0700 (PDT) Original-To: PT In-Reply-To: Content-Disposition: inline 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26053 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26053 On 4/26/05, PT wrote: > Or maybe an association list? '((value1 . 3) (value2 . 4) (value3 . 5)) > It's certainly more resistant to code changes, but feels a bit > heavyweight. (Maybe its just me.) You could use a plist: (:key1 1 :key2 2) Then to get a particular value: (getf '(:key1 1 :key2 2) :key1) =3D> 1 According to C-h f getf RET: getf is a compiled Lisp function in `cl-extra'. (getf plist tag &optional def) So you might need to do (require 'cl) before using it.... -Denis PGP: http://pgp.mit.edu:11371/pks/lookup?search=3D0xA1B51B4B&op=3Dindex