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

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

bug#27584: 26.0.50; alist-get: Add optional arg TESTFN


From: Tino Calancha
Subject: bug#27584: 26.0.50; alist-get: Add optional arg TESTFN
Date: Sun, 9 Jul 2017 23:48:32 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)



On Sat, 8 Jul 2017, Eli Zaretskii wrote:

From: Nicolas Petton <nicolas@petton.fr>
Cc: monnier@iro.umontreal.ca, 27584@debbugs.gnu.org
Date: Sat, 08 Jul 2017 13:32:11 +0200

That's one way, yes.  But not necessarily the one I had in mind.

What solution did you have in mind?

Something like this:

 FOR_EACH_TAIL (tail)
   {
     Lisp_Object car = XCAR (tail);
     if (CONSP (car)
          && (NILP (testfn)
              ? (EQ (XCAR (car), key) || !NILP (Fequal (XCAR (car), key)))
              : !NILP (call2 (testfn, XCAR (car), key))))
        return car;
   }
Nice!





reply via email to

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