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 20:36:31 +0200 Message-ID: <87bntr8jtc.fsf@gmail.com> References: <87d2e78nn7.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403030235 29242 80.91.229.3 (17 Jun 2014 18:37:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Jun 2014 18:37:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Stefan Monnier" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 17 20:37:08 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 1WwyFn-0005e0-HX for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Jun 2014 20:37:07 +0200 Original-Received: from localhost ([::1]:52767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwyFn-0002rG-5O for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Jun 2014 14:37:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwyFT-0002pr-Cd for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 14:36:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwyFG-0008Da-Vx for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 14:36:47 -0400 Original-Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:62523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwyFG-0008DR-MP for help-gnu-emacs@gnu.org; Tue, 17 Jun 2014 14:36:34 -0400 Original-Received: by mail-wg0-f41.google.com with SMTP id a1so7595874wgh.12 for ; Tue, 17 Jun 2014 11:36:33 -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=7FC2bGlzSwNXchq4ulmhk8WBNyUwmhO86NDRpetsDXs=; b=hGuEykIAx4vlaNI6XzGbfKMwsNwa1b4fzfMx2isBi8vdP4+pAkT5mGrnY0SVYAFial fBA/WXxoLgEcAEH8lVjU8n9hu77MDuZoG5eaMZDtAGM8Vx0KxKpEmWuZNdUyRqtWA7vr f+a053n9nHqScVSpZRJ4zoB9iTV1H8+etkb6Q5aR3eovDXRhnn8JzXsNycriqVkPuQIv iT/oIhnTV5v3nn+ezQX8zjdRV2pPtJbdVu6vlbpLlFXuojhayUgaZx21dEmN045yMplD LF2wVAI4qzZxn8nWTh1c32H+L9F466DetKAY2oG/3FBn2yuQefWwxw/dUnLk78RLMTa1 zbcQ== X-Received: by 10.180.73.116 with SMTP id k20mr39232106wiv.16.1403030193846; Tue, 17 Jun 2014 11:36:33 -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 v15sm24487679wjq.17.2014.06.17.11.36.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 11:36:32 -0700 (PDT) User-agent: mu4e 0.9.9.5; emacs 24.3.1 In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::229 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:98313 Archived-At: 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