unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: PT <mailshield.gg@mailnull.com>
Subject: Function binders in Elisp?
Date: Sun, 17 Apr 2005 19:47:53 +0200	[thread overview]
Message-ID: <opspd013hnp52o26@home-ca12fabbc0> (raw)

For predicates I usually use lambda functions. For example:

   (require 'cl)
   (remove-if (lambda (x) (> x 2))
              '(1 2 3 4))

I'm not a lisp guru, therefore I often wonder if there are standard binder  
functions in emacs lisp like for example bind2nd in C++ STL which  
transforms a binary function into an unary function:

   find_if(L.begin(), L.end(), bind2nd(greater<int>(), 2)) // C++

So that I can write something like this:

   (remove-if (bind-second '< 2)
              '(1 2 3 4))

             reply	other threads:[~2005-04-17 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 17:47 PT [this message]
2005-04-18 16:26 ` Function binders in Elisp? rgb
2005-04-18 18:15   ` PT
2005-04-18 20:20     ` Thien-Thi Nguyen
2005-04-18 22:45     ` Pascal Bourguignon

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=opspd013hnp52o26@home-ca12fabbc0 \
    --to=mailshield.gg@mailnull.com \
    /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.
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).