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

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

bug#30202: 27.0.50; Code refactoring on assq-delete-all assoc-delete-all


From: Stefan Monnier
Subject: bug#30202: 27.0.50; Code refactoring on assq-delete-all assoc-delete-all
Date: Mon, 22 Jan 2018 08:17:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> yesterday was added (how about to announce it in NEWS file?)
> the new function `assoc-delete-all', which is pretty much
> the same as `assq-delete-all' with `equal' instead of `eq'.
> How do you think below patch?

How 'bout defining

(defun assoc-delete-all (key alist &optional test)
  (unless test (setq test #'equal))
  ...)


> IIUC, the byte compiler will carry the substitution
> (funcall function foo bar)
> into
> (function foo bar)
> so that compile code won't suffer the funcall overhead, right?

IIRC both forms result in the same bytecode except that the longer form
will not benefit from inlining and/or the use of specialized bytecodes
(e.g. when `foo` is `equal`).


        Stefan





reply via email to

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