From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.help Subject: Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp? Date: Tue, 17 Jun 2014 21:06:55 +0200 Message-ID: <878uov8ieo.fsf@gmail.com> References: <87d2e78nn7.fsf@gmail.com> <87bntr8jtc.fsf@gmail.com> <155DEC68569B714B86C2C7075F5EDA9892AFE1CD@DAKIYA1.pegasus.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403032053 18530 80.91.229.3 (17 Jun 2014 19:07:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Jun 2014 19:07:33 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" , Stefan Monnier To: "Doug Lewan" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 17 21:07:28 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 1Wwyj9-0005MC-3C for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Jun 2014 21:07:27 +0200 Original-Received: from localhost ([::1]:52880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwyj8-0008EL-KB for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Jun 2014 15:07:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwyim-0008CO-2m for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 15:07:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwyig-0002kv-Kh for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 15:07:04 -0400 Original-Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:47746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwyig-0002jg-Dh for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 15:06:58 -0400 Original-Received: by mail-wi0-f180.google.com with SMTP id hi2so6403413wib.13 for ; Tue, 17 Jun 2014 12:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:user-agent:in-reply-to:date :message-id:mime-version:content-type; bh=AHh72Rr+hnDSc7ReNx8g9zv1YRsDuwNb9bfB2iRb09w=; b=FQIBw1IBQMsAxQ0JfCG5FZdLKIEmCFB+obImgp6gU2LwuhHAhgLhanHn+DMXXHhlJ3 wiGnqmp/xeUviVyiAu3BLKtPeceMzTkyffe4jvMt4mrZ4utHfNaNSlTt5LVe7ssG93q7 xe5nab7IixDrxxjquaqpivU48/Nn3i8NNruyCozjtxlGd9qk7ylwLK1YWH7MgK2npSwR MlEPsuLX80nMji+hGp3u6z2GBpi92EK6mWbFV4omYGhDdsYR/nk0BitYkFisy345yKAl xm69yi90z5q3e29Ri3Sq/nkuFze2OeUqnnvVIVPXVPZNiAubBqEtTPdhNSbjsvKIXQHQ 5tTA== X-Received: by 10.194.5.103 with SMTP id r7mr40346296wjr.41.1403032017511; Tue, 17 Jun 2014 12:06:57 -0700 (PDT) Original-Received: from blueberry (hel59-4-88-160-125-31.fbx.proxad.net. [88.160.125.31]) by mx.google.com with ESMTPSA id bp2sm21671782wib.9.2014.06.17.12.06.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 12:06:56 -0700 (PDT) User-agent: mu4e 0.9.9.5; emacs 24.3.1 In-reply-to: <155DEC68569B714B86C2C7075F5EDA9892AFE1CD@DAKIYA1.pegasus.local> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 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:98316 Archived-At: Doug Lewan writes: > 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 ...)) Do you mean that you are ok with using the above or that you'd like to have remove-if built into the language? > > ,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=shubertticketing.com@gnu.org >> [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.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? >> >> >> Stefan Monnier writes: >> >> >> 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? >> >> 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. >> >> To filter lists, one has to implement its own version of this function, >> or require an external library. Same goes for `find-if`. >> >> 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. >> >> Cheers, >> Nico