From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to iterate over properties in a plist? Date: Sat, 01 Aug 2015 00:29:35 +0200 Message-ID: <874mkkvu40.fsf@mbork.pl> References: <876150vwaa.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438381827 15796 80.91.229.3 (31 Jul 2015 22:30:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2015 22:30:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 01 00:30:16 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZLIoh-0001Xm-FQ for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Aug 2015 00:30:15 +0200 Original-Received: from localhost ([::1]:46210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLIog-0005q9-Lp for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Jul 2015 18:30:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLIoW-0005pB-T7 for help-gnu-emacs@gnu.org; Fri, 31 Jul 2015 18:30:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLIoR-0005D3-At for help-gnu-emacs@gnu.org; Fri, 31 Jul 2015 18:30:04 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:41653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLIoR-0005Cn-40 for help-gnu-emacs@gnu.org; Fri, 31 Jul 2015 18:29:59 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 0452C8F2003 for ; Sat, 1 Aug 2015 00:29:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q2kFaIPlui2E for ; Sat, 1 Aug 2015 00:29:42 +0200 (CEST) Original-Received: from localhost (unknown [109.232.24.146]) by mail.mojserwer.eu (Postfix) with ESMTPSA id A5D138F2002 for ; Sat, 1 Aug 2015 00:29:42 +0200 (CEST) In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.110.48.8 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:106172 Archived-At: On 2015-08-01, at 00:18, Stefan Monnier wrote: >> I need to iterate over all properties in a plist. > > First things first: go complain to whoever decided to use a plist > instead of an alist. Why? I did consider both and decided that a plist will be better in my use-case. Reasons: it is short anyway (no more than 3-5 properties at most), and I need to change it frequently (i.e., change the values of individual properties). This last operation seems much nicer in a plist. AFAIK, the "canonical" way to change a key-value pair in an alist is to push the new one at the beginning. In my case, the list will grow quickly. > Stefan Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University