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: Eli Zaretskii
Subject: bug#27584: 26.0.50; alist-get: Add optional arg TESTFN
Date: Sat, 08 Jul 2017 14:46:09 +0300

> From: Nicolas Petton <address@hidden>
> Cc: address@hidden, address@hidden
> 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;
    }





reply via email to

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