all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Petton <petton.nicolas@gmail.com>
To: "Doug Lewan" <dougl@shubertticketing.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp?
Date: Tue, 17 Jun 2014 21:06:55 +0200	[thread overview]
Message-ID: <878uov8ieo.fsf@gmail.com> (raw)
In-Reply-To: <155DEC68569B714B86C2C7075F5EDA9892AFE1CD@DAKIYA1.pegasus.local>


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




  reply	other threads:[~2014-06-17 19:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 17:13 Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp? Nicolas Petton
2014-06-17 17:28 ` Stefan Monnier
2014-06-17 18:36   ` Nicolas Petton
2014-06-17 18:56     ` Doug Lewan
2014-06-17 19:06       ` Nicolas Petton [this message]
2014-06-17 19:55         ` Doug Lewan
2014-06-17 22:16     ` Stefan Monnier
2014-06-18 11:00       ` Nicolas Petton
     [not found]       ` <mailman.3879.1403089222.1147.help-gnu-emacs@gnu.org>
2014-06-18 14:36         ` Stefan Monnier
2014-06-18 14:43         ` Barry Margolin
2014-06-18 15:43           ` Damien Cassou
2014-06-18 16:31             ` Phillip Lord
     [not found]           ` <mailman.3896.1403106263.1147.help-gnu-emacs@gnu.org>
2014-06-24 13:51             ` Christoph Wedler
2014-06-24 16:24               ` Barry Margolin
2014-06-25  3:22                 ` Stefan Monnier
2014-06-25  4:08                   ` Leo Liu
     [not found]                   ` <mailman.4252.1403669342.1147.help-gnu-emacs@gnu.org>
2014-06-25 13:46                     ` Stefan Monnier
     [not found]                 ` <mailman.4251.1403666567.1147.help-gnu-emacs@gnu.org>
2014-06-25 10:24                   ` Christoph Wedler
2014-06-25 13:35                     ` Stefan Monnier
2014-06-25 14:09                     ` Stefan Monnier
2014-06-25 15:37                     ` Barry Margolin
2014-06-25 23:44                       ` Robert Thorpe
2014-06-18 14:43         ` Pascal J. Bourguignon
     [not found] ` <mailman.3837.1403026153.1147.help-gnu-emacs@gnu.org>
2014-06-20  0:20   ` WJ
2014-06-20 13:45     ` Stefan Monnier
     [not found] <mailman.3836.1403025251.1147.help-gnu-emacs@gnu.org>
2014-06-17 21:42 ` Barry Margolin
     [not found] <mailman.4322.1403739913.1147.help-gnu-emacs@gnu.org>
2014-06-26  0:37 ` Stefan Monnier
2014-06-26  5:27 ` Barry Margolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878uov8ieo.fsf@gmail.com \
    --to=petton.nicolas@gmail.com \
    --cc=dougl@shubertticketing.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.