all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Stefan Monnier <monnier@IRO.UMontreal.CA>, emacs-devel@gnu.org
Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations
Date: Mon, 26 Feb 2018 12:15:25 -0500	[thread overview]
Message-ID: <9100fb65-a95a-0678-68fa-7d615d481284@gmail.com> (raw)
In-Reply-To: <87po4rpv02.fsf@web.de>

On 2018-02-26 11:37, Michael Heerdegen wrote:
> Hello Clément,

Hey Michael,

> Are we sure `mmm' always does what you expect?

Hard to say. I'm trying to gauge how much of what I observe is a bug, and how much is expected :)

> Note that it gets called
> with different arguments in these two cases.  

I think that's a problem, yes.  But is it the expected behavior for it to be called with different arguments?

> You have
> 
> (mmm (lambda () nil)) ==> (lambda nil nil)
> 
> With the `with-eval-after-load' called before `mmm' is defined, I get an
> entry like this in `after-load-alist':
> 
> | (test-macro
> |   #[0 #1="byte code..."
> |       [(lambda nil
> |          (let
> |              ((out
> |                (mmm
> |                 #'(lambda nil nil))))
> |            (message "with-eval-after-load: %S" out)))
> |       ...]
> |       11])

Right, I think that's broken.

> Maybe you can change `mmm' so that it handles both of these cases as you
> want?

We're considering this for Flycheck, yup :)  I suggested a similar solution in https://github.com/flycheck/flycheck/issues/1398#issuecomment-365660601

Or use a function like (defun mmm2 (f) `#',f)?

I don't think that works for our particular use case, because we need to handle unquoted functions.

Mostly though, I'd like to understand where the issue comes from (my current understanding is that it's a miscompilation), and whether it can be fixed.

(The original problem popped up a few years ago from a user of use-package, but back then we didn't track it down; this time I'd like to fix it once and for all)

Thanks for your help!
Clément.



  reply	other threads:[~2018-02-26 17:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 16:04 A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations Clément Pit-Claudel
2018-02-17 21:58 ` Stefan Monnier
2018-02-18 15:17   ` Clément Pit-Claudel
2018-02-18 18:02     ` Stefan Monnier
2018-02-25 18:09       ` Clément Pit-Claudel
2018-02-26  3:18         ` Stefan Monnier
2018-02-26  5:40           ` Clément Pit-Claudel
2018-02-26 13:11             ` Stefan Monnier
2018-02-26 15:20               ` Clément Pit-Claudel
2018-02-26 16:31                 ` Stefan Monnier
2018-02-26 16:38                   ` Stefan Monnier
2018-02-26 17:08                     ` Clément Pit-Claudel
2018-02-26 17:31                       ` Stefan Monnier
2018-02-28 14:32                         ` Clément Pit-Claudel
2018-02-28 16:02                           ` Stefan Monnier
2018-02-26 17:01                   ` Clément Pit-Claudel
2018-02-26 17:13                     ` Stefan Monnier
2018-02-26 17:32                       ` Clément Pit-Claudel
2018-02-26 17:40                         ` Clément Pit-Claudel
2018-03-01  0:50                       ` Radon Rosborough
2018-02-27 21:35                     ` Stefan Monnier
2018-02-28 12:44                       ` Michael Heerdegen
2018-02-28 13:31                         ` Stefan Monnier
2018-02-28 14:26                       ` Clément Pit-Claudel
2018-02-28 23:12                         ` Stefan Monnier
2018-02-26 13:13             ` Stefan Monnier
2018-02-26 15:20               ` Clément Pit-Claudel
2018-02-26 16:33                 ` Stefan Monnier
2018-02-26 16:37         ` Michael Heerdegen
2018-02-26 17:15           ` Clément Pit-Claudel [this message]
2018-02-26 17:38             ` 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

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

  git send-email \
    --in-reply-to=9100fb65-a95a-0678-68fa-7d615d481284@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@IRO.UMontreal.CA \
    /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.