GNU bug report logs - #30202
27.0.50; Code refactoring on assq-delete-all assoc-delete-all

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Mon, 22 Jan 2018 05:26:01 UTC

Severity: wishlist

Found in version 27.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 30202 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 30202 <at> debbugs.gnu.org
Subject: Re: bug#30202: 27.0.50;
 Code refactoring on assq-delete-all assoc-delete-all
Date: Mon, 22 Jan 2018 08:17:44 -0500
> 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




This bug report was last modified 7 years and 121 days ago.

Previous Next


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