From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: How to get plist properties list? Date: Sat, 9 Jan 2021 10:27:33 +0100 Message-ID: <20210109092733.GB20537@tuxteam.de> References: <7eec4142-3c37-4084-9ea1-73df5df2c821@default> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FkmkrVfFsRoUs1wW" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7936"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Stefan Monnier To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 09 10:28:42 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kyAY6-0001yV-Dj for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 10:28:42 +0100 Original-Received: from localhost ([::1]:46314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyAY5-00027Y-Fw for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 04:28:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyAXF-00026G-0e for help-gnu-emacs@gnu.org; Sat, 09 Jan 2021 04:27:49 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:46244) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1kyAXA-0005od-HC for help-gnu-emacs@gnu.org; Sat, 09 Jan 2021 04:27:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:Date; bh=Bnx/RdaHzpIXylSZYnYPoVsy7VpnlbuuJ1UBsjQMpt0=; b=d+VMkLPqZ/HcG10Hzcn0FZUHiClG7xzK0oVIz9t1Hcx2sxEr3kV+oK6wpl8Sgx2zG0TDTYrS890Ev5hh7PahGXQnRNWY8fe/4raR8uf02DcXSF07G5KwcqLKilJA6XfaUPtYVvueIwyRCo8HSn9JeUALTEo+hCEB2wo7QSEaHXh7qBOe253aoy8cdZuhMCkqoAWV6thIoPHtaQ0Bx5Qjyp6iJp1sDtTjLb9RZgTQad6jin5ui9Z/Wdzmgf6eVvdZfKyqFs6+q6MVhAI+Ul5tdBoJps/a1t/aSQNEgcbGcL3wUG5XtqXZkRSQwjCd2OcY5tyi2Fvq3Bnw7bE4bF/36A==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1kyAWz-0005sf-PN; Sat, 09 Jan 2021 10:27:33 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127120 Archived-At: --FkmkrVfFsRoUs1wW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 09, 2021 at 10:54:17AM +0300, Jean Louis wrote: > * Stefan Monnier [2021-01-08 09:51]: > > > I would like to understand what is the problem. I don't. You tell me > > > that `elt' is problem, that is how I understand it. > > > > > > Could I maybe rather use `nth' to replace `elt'? > >=20 > > No, same problem. > > Think of it this way: consider your list of N elements as a road that's > > N kilometers long [...] (nice explanation, BTW :) > So far I have seen from similar discussion on `length' on emacs-devel > mailing list [...] When you have a toolbox (a language & library), you usually develop a set of "ways of doing things", corresponding to the properties your tools have. > If I wish to get the element like number 17th I do not know what I > should do. (nth 17 my-list) Unless... you are doing it very often. Then you do something different (unless, again, you don't care that your program is slow; if you are giving your program to other people, you should care, somewhat, at least. And so on. Lists are very flexible data structures. But they have one downside: accessing a random element in them takes as long as walking through half of it, in the average. If you plan to access elements by index, Emacs Lisp has arrays. They aren't as flexible, but faster for random access. If you want more flexibility, there are hash tables. And so on. It's like with tools. You use the screwdriver to drive screws. In a pinch, you can use it to poke dirt out of a hole. I've seen people using it to hit a hole in a wall (hm.) or even to drive a nail into a piece of wood (ouch!). Cheers :) - t --FkmkrVfFsRoUs1wW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl/5dwUACgkQBcgs9XrR2kbNwwCfVGd2HDnxuitqJna+nreLOpjx rzQAniEyazMRyDfhfG5tMcdF36p8d338 =LeyE -----END PGP SIGNATURE----- --FkmkrVfFsRoUs1wW--