* Add a filter function to emacs @ 2010-07-07 19:45 Rolando Pereira 2010-07-08 6:36 ` Geoff Gole 2010-07-08 9:12 ` Deniz Dogan 0 siblings, 2 replies; 3+ messages in thread From: Rolando Pereira @ 2010-07-07 19:45 UTC (permalink / raw) To: emacs-devel Hello, I would like to know if there is a reason for the lack of a filter function on the emacs code base. According to the Elisp Cookbook on the Emacs Wiki, it seems that it would be simple to implement: (defun my-filter (condp lst) (delq nil (mapcar (lambda (x) (and (funcall condp x) x)) lst))) ;; From http://www.emacswiki.org/emacs/ElispCookbook Shouldn't this function be in the regular emacs code base (maybe in the lisp/simple.el file)? Is there any problem with it? ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Add a filter function to emacs 2010-07-07 19:45 Add a filter function to emacs Rolando Pereira @ 2010-07-08 6:36 ` Geoff Gole 2010-07-08 9:12 ` Deniz Dogan 1 sibling, 0 replies; 3+ messages in thread From: Geoff Gole @ 2010-07-08 6:36 UTC (permalink / raw) To: Rolando Pereira; +Cc: emacs-devel > > I would like to know if there is a reason for the lack of a filter > function on the emacs code base. > See remove-if and remove-if-not in cl.el. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Add a filter function to emacs 2010-07-07 19:45 Add a filter function to emacs Rolando Pereira 2010-07-08 6:36 ` Geoff Gole @ 2010-07-08 9:12 ` Deniz Dogan 1 sibling, 0 replies; 3+ messages in thread From: Deniz Dogan @ 2010-07-08 9:12 UTC (permalink / raw) To: Rolando Pereira; +Cc: emacs-devel 2010/7/7 Rolando Pereira <ei08150@fe.up.pt>: > Hello, > > I would like to know if there is a reason for the lack of a filter > function on the emacs code base. > > According to the Elisp Cookbook on the Emacs Wiki, it seems that it > would be simple to implement: > > (defun my-filter (condp lst) > (delq nil > (mapcar (lambda (x) (and (funcall condp x) x)) lst))) > ;; From http://www.emacswiki.org/emacs/ElispCookbook > > Shouldn't this function be in the regular emacs code base (maybe in the > lisp/simple.el file)? > > Is there any problem with it? > > I brought this up some time ago as I found that many higher-order functions were missing in (non-cl.el) Emacs. If I remember correctly, it's the lack of lexical scoping that makes it difficult. -- Deniz Dogan ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-08 9:12 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-07-07 19:45 Add a filter function to emacs Rolando Pereira 2010-07-08 6:36 ` Geoff Gole 2010-07-08 9:12 ` Deniz Dogan
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git 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).