unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Zhu Zihao <all_but_last@163.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Tomas Hlavaty <tom@logand.com>, emacs-devel@gnu.org
Subject: Re: named-let
Date: Wed, 13 Jan 2021 16:11:44 +0800	[thread overview]
Message-ID: <864kjl8ddr.fsf@163.com> (raw)
In-Reply-To: <jwvzh1f3y4z.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]


Stefan Monnier writes:

> And we can also use approaches like "inline, together with a check that
> the function was not advised" for functions which have not been
> officially declared as inlinable (such checks are already used in the
> native-comp code, IIRC, tho just to use "fast call" rather than do
> inlining).

I'm not sure I understand it. Given code like

(defun add1 (b)
  (+ b 1))

(defun test ()
  (advice-add (intern "add1") :after (lambda (&rest _)
                                       (message "Whoa!")))
  (+ 10 (add1 20)))

We want to inline (add1 20) so the program becomes (+ 10 (+ 1 20)). But
advice can happened at run time. For example, I run advice-add in the
body of function "test" before calling "add1". What's more, that call to
advice-add may hidden in another function(And that function may also be
adviced) and make the program very complicated and hard to determine in
compile time. Would native-comp break the semantic of that program or not?

-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]

  parent reply	other threads:[~2021-01-13  8:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09  1:43 named-let Stefan Monnier
2021-01-09  8:58 ` named-let tomas
2021-01-09 16:01   ` named-let Joost Kremers
2021-01-09 21:48     ` named-let Stefan Monnier
2021-01-09 15:23 ` named-let Tomas Hlavaty
2021-01-09 16:44   ` named-let Stefan Monnier
2021-01-09 17:03     ` named-let Helmut Eller
2021-01-09 18:43       ` named-let Stefan Monnier
2021-01-09 18:47     ` named-let Tomas Hlavaty
2021-01-10 18:49   ` named-let Zhu Zihao
2021-01-11 22:27     ` named-let Tomas Hlavaty
2021-01-11 22:36       ` named-let Stefan Monnier
2021-01-11 22:48         ` named-let Tomas Hlavaty
2021-01-11 22:50         ` named-let Andrea Corallo via Emacs development discussions.
2021-01-11 23:10           ` named-let Stefan Monnier
2021-01-11 23:28             ` named-let Andrea Corallo via Emacs development discussions.
2021-01-11 23:57               ` named-let Stefan Monnier
2021-01-12  9:24                 ` named-let Andrea Corallo via Emacs development discussions.
2021-01-12 18:07                   ` named-let Stefan Monnier
2021-01-12 18:50                     ` named-let Andrea Corallo via Emacs development discussions.
2021-01-12  9:13             ` named-let Helmut Eller
2021-01-13  8:11         ` Zhu Zihao [this message]
2021-01-13 14:01           ` named-let Stefan Monnier
2021-01-11 22:40       ` named-let Andrea Corallo via Emacs development discussions.
2021-01-11 22:51         ` named-let Tomas Hlavaty
2021-01-11 23:04           ` named-let Andrea Corallo via Emacs development discussions.
2021-01-12  0:12             ` named-let Tomas Hlavaty
2021-01-20 19:44 ` named-let Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=864kjl8ddr.fsf@163.com \
    --to=all_but_last@163.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=tom@logand.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).