GNU bug report logs - #48261
28.0.50; Optimize `eql' to `eq' for fixnums

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Thu, 6 May 2021 17:21:02 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Mattias EngdegÄrd <mattiase <at> acm.org>, "48261 <at> debbugs.gnu.org" <48261 <at> debbugs.gnu.org>, Philipp <p.stephani2 <at> gmail.com>
Subject: bug#48261: [External] : bug#48261: 28.0.50; Optimize `eql' to `eq' for fixnums
Date: Fri, 7 May 2021 15:24:59 +0000
> (We really should have fast, readable, always-available 
> standard functions or macros for 'some' and 'every' on lists.)

Does this qualify?

(defun some-elt-p (xs pred)
  "Return non-nil if (PRED X) is true for some element of list XS."
  (catch 'some-element-p
    (dolist (x  xs)
      (and (funcall pred x)  (throw 'some-element-p t)))))

(defun all-elts-p (xs pred)
  "Return non-nil if (PRED X) is true for all elements of list XS."
  (catch 'all-elts-p
    (dolist (x  xs  t)
      (or (funcall pred x)  (throw 'all-elts-p nil)))))

[I think I'd prefer the opposite arg order: PRED first,
 but this is at least the same as what CL uses.  Consider
 (apply-partially #'some-elt-p PRED), for instance.]




This bug report was last modified 4 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.