all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 30202@debbugs.gnu.org
Subject: bug#30202: 27.0.50; Code refactoring on assq-delete-all assoc-delete-all
Date: Mon, 22 Jan 2018 08:17:44 -0500	[thread overview]
Message-ID: <jwvwp0a6nq0.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87r2qilb3d.fsf@gmail.com> (Tino Calancha's message of "Mon, 22 Jan 2018 14:24:38 +0900")

> 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	other threads:[~2018-01-22 13:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22  5:24 bug#30202: 27.0.50; Code refactoring on assq-delete-all assoc-delete-all Tino Calancha
2018-01-22 13:17 ` Stefan Monnier [this message]
2018-01-22 15:04   ` Tino Calancha
2018-01-22 15:46 ` Eli Zaretskii
2018-01-23  0:02   ` Tino Calancha
2018-01-23 16:05     ` Eli Zaretskii
2018-01-24  3:10       ` Tino Calancha
2018-01-28  4:12         ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvwp0a6nq0.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=30202@debbugs.gnu.org \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.