help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp?


From: Nicolas Petton
Subject: Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp?
Date: Tue, 17 Jun 2014 21:06:55 +0200
User-agent: mu4e 0.9.9.5; emacs 24.3.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]