From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: return first element in list with certain property Date: Tue, 21 Nov 2017 12:47:51 -0800 (PST) Message-ID: <8851bcac-fbbf-4c1e-a6b9-98da99f6bf07@default> References: <8660a60zjn.fsf@zoho.com> <87mv3gzndx.fsf@ericabrahamsen.net> <86ine4y7jy.fsf@zoho.com> <874lpozk0y.fsf@ericabrahamsen.net> <8660a4xuou.fsf@zoho.com> <31dcbfa2-8d13-463c-bbab-fe5109bbab37@default> <863757wfmd.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1511297311 27385 195.159.176.226 (21 Nov 2017 20:48:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Nov 2017 20:48:31 +0000 (UTC) To: Emanuel Berg , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 21 21:48:27 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHFT0-0006pT-De for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 21:48:26 +0100 Original-Received: from localhost ([::1]:36431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHFT7-0000a1-Ox for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 15:48:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHFSc-0000Zs-SX for help-gnu-emacs@gnu.org; Tue, 21 Nov 2017 15:48:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHFSY-0005ch-1S for help-gnu-emacs@gnu.org; Tue, 21 Nov 2017 15:48:02 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:33401) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHFSX-0005bp-O3 for help-gnu-emacs@gnu.org; Tue, 21 Nov 2017 15:47:57 -0500 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vALKlr7r008746 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2017 20:47:53 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vALKlqTZ017034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2017 20:47:52 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vALKlqt2017886; Tue, 21 Nov 2017 20:47:52 GMT In-Reply-To: <863757wfmd.fsf@zoho.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4615.0 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:115040 Archived-At: > > So yes, not choosing to use `cl-find' in your > > Emacs-Lisp code just because it traverses the > > list twice is silly and is most likely > > premature optimization. >=20 > So yes, you are silly. I didn't choose not to use `cl-find'. Did you? For that reason alone ("just because")? FWIW, I tend to use just the catch-throw idiom, partly because some of my code supports also Emacs versions that predate `cl-lib.el'. But I don't think I have any code that searches long enough lists that such performance considerations would be worthwhile.