unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* filter-list
@ 2014-04-16 22:01 Michael Heerdegen
  2014-04-17  2:13 ` filter-list Grant Rettke
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2014-04-16 22:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Is there something like

| (defun filter-list (pred list)
|   "Make a list of all LIST elements satisfying PRED."
|   (let ((deleted '#:deleted))
|     (delete deleted
|             (mapcar (lambda (el) (if (funcall pred el) el deleted))
|                     list))))

existing in Emacs Lisp?  I can't find it, but I would expect such
an elementary function would be built in.  Do I miss something?


Thanks,

Michael.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: filter-list
       [not found] <mailman.19722.1397685716.10748.help-gnu-emacs@gnu.org>
@ 2014-04-17  0:54 ` Stefan Monnier
  2014-04-17 12:28   ` filter-list Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2014-04-17  0:54 UTC (permalink / raw)
  To: help-gnu-emacs

> Is there something like
> | (defun filter-list (pred list)

There's cl-remove-if.


        Stefan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: filter-list
  2014-04-16 22:01 filter-list Michael Heerdegen
@ 2014-04-17  2:13 ` Grant Rettke
  2014-04-17 12:33   ` filter-list Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Rettke @ 2014-04-17  2:13 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Emacs Help

https://github.com/magnars/dash.el#-filter-pred-list
Grant Rettke | AAAS, ACM, FSF, IEEE, Sigma Xi
grettke@acm.org | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Wed, Apr 16, 2014 at 5:01 PM, Michael Heerdegen
<michael_heerdegen@web.de> wrote:
> Hi,
>
> Is there something like
>
> | (defun filter-list (pred list)
> |   "Make a list of all LIST elements satisfying PRED."
> |   (let ((deleted '#:deleted))
> |     (delete deleted
> |             (mapcar (lambda (el) (if (funcall pred el) el deleted))
> |                     list))))
>
> existing in Emacs Lisp?  I can't find it, but I would expect such
> an elementary function would be built in.  Do I miss something?
>
>
> Thanks,
>
> Michael.
>
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: filter-list
  2014-04-17  0:54 ` filter-list Stefan Monnier
@ 2014-04-17 12:28   ` Michael Heerdegen
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2014-04-17 12:28 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > | (defun filter-list (pred list)
>
> There's cl-remove-if.

Indeed, thanks.  I was overlooking it because it's only in a side note
in the cl manual.

Michael.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: filter-list
  2014-04-17  2:13 ` filter-list Grant Rettke
@ 2014-04-17 12:33   ` Michael Heerdegen
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2014-04-17 12:33 UTC (permalink / raw)
  To: help-gnu-emacs

Grant Rettke <gcr@wisdomandwonder.com> writes:

> https://github.com/magnars/dash.el#-filter-pred-list

Indeed a good source for diverse list processing functions.

Thanks,

Michael.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-17 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 22:01 filter-list Michael Heerdegen
2014-04-17  2:13 ` filter-list Grant Rettke
2014-04-17 12:33   ` filter-list Michael Heerdegen
     [not found] <mailman.19722.1397685716.10748.help-gnu-emacs@gnu.org>
2014-04-17  0:54 ` filter-list Stefan Monnier
2014-04-17 12:28   ` filter-list Michael Heerdegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).