From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp? Date: Wed, 18 Jun 2014 16:43:48 +0200 Organization: Informatimago Message-ID: <87egymp9az.fsf@kuiper.lan.informatimago.com> References: <87d2e78nn7.fsf@gmail.com> <87bntr8jtc.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1403103029 27752 80.91.229.3 (18 Jun 2014 14:50:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Jun 2014 14:50:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 18 16:50:24 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 1WxHBr-0008MC-R3 for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Jun 2014 16:50:19 +0200 Original-Received: from localhost ([::1]:57840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxHBr-0005e5-Fn for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Jun 2014 10:50:19 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net zERHJNLheWpllZ56Bxy0vgJvG9icx+E6KDVDBZlA/yaPTu7wba Cancel-Lock: sha1:MzQ5Y2JlMjczMGQxMmY4Y2JiOTRiZGFkNzk2NGQwY2Q0NTdkYWE0Ng== sha1:zUEsQKxNTAj2egQXqdp+vwQS9fE= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:206066 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:98337 Archived-At: Nicolas Petton writes: > 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` >> >> Of course it does, tho it calls it `cl-remove-if'. > > Yes, but what I meant was that there is no filtering function in Elisp > itself (cl-remove-if is part of cl-lib). > > But Barry's answer explains it. Now I'm wondering if it would make sense > to have such functions in Elisp itself? Yes, it would makes sense. And just name them find, find-if, remove-if! (defun remove-if (&rest args) (apply (function cl-remove-if) args)) ;; … -- __Pascal Bourguignon__ http://www.informatimago.com/ "Le mercure monte ? C'est le moment d'acheter !"