From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Lewan Newsgroups: gmane.emacs.help Subject: RE: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp? Date: Tue, 17 Jun 2014 18:56:28 +0000 Message-ID: <155DEC68569B714B86C2C7075F5EDA9892AFE1CD@DAKIYA1.pegasus.local> References: <87d2e78nn7.fsf@gmail.com> <87bntr8jtc.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1403031422 11133 80.91.229.3 (17 Jun 2014 18:57:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Jun 2014 18:57:02 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Nicolas Petton , Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 17 20:56:54 2014 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 1WwyYv-0007eV-DC for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Jun 2014 20:56:53 +0200 Original-Received: from localhost ([::1]:52863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwyYv-0003vm-4A for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Jun 2014 14:56:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwyYd-0003nI-3w for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 14:56:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwyYX-0007r6-HE for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 14:56:35 -0400 Original-Received: from webmail.shubertorg.com ([207.246.209.200]:38605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwyYX-0007qo-DJ for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 14:56:29 -0400 Original-Received: from dakiya1.pegasus.local ([172.16.208.201]) by DAKIYA1.pegasus.local ([172.16.208.201]) with mapi id 14.02.0247.003; Tue, 17 Jun 2014 14:56:29 -0400 Thread-Topic: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp? Thread-Index: AQHPik+X5Yb4qbZdPUSVCvjMG6s2Rpt1jsKJgABVyoD//8IZMA== In-Reply-To: <87bntr8jtc.fsf@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.21.202] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 207.246.209.200 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:98315 Archived-At: While I won't make assertions about how Emacs Lisp as a language should be,= I am comfortable saying that I write code like the following a lot: (delete nil (mapcar ...)) ,Douglas Douglas Lewan Shubert Ticketing (201) 489-8600 ext 224 LISP: The most intelligent way to misuse a computer. > -----Original Message----- > From: help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org > [mailto:help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org] On > Behalf Of Nicolas Petton > Sent: Tuesday, 2014 June 17 14:37 > To: Stefan Monnier > Cc: help-gnu-emacs@gnu.org > Subject: Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs > Lisp? >=20 >=20 > Stefan Monnier writes: >=20 > >> Emacs Lisp is a great Lisp dialect, but I miss `find`, `find-if`, > >> `remove-if`, etc. iteration functions a lot. Sure, I can require cl- > lib > >> or use dash, but I'm wondering why these functions are not part of > the > >> base language? > > > > Not sure what you mean. Most languages I know provide list > operations > > via libraries. Why should Elisp be different? >=20 > What I mean is that Elisp do not have `remove-if` (or any equivalent > function, I don't necessarily mean the CL remove-if function), a > function that I think could be in the language. >=20 > To filter lists, one has to implement its own version of this function, > or require an external library. Same goes for `find-if`. >=20 > I was wondering if Emacs Lisp was lacking this function for some reason > (or did I completely miss it? could be too). If not, why not add it to > the language? It looks to me like a badly missing feature, I think > filtering collections is something very common. >=20 > Cheers, > Nico