emacs-devel
[Top][All Lists]
Advanced

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

Re: A combination of defmacro, functionp, and quoted lambdas yields diff


From: Michael Heerdegen
Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations
Date: Mon, 26 Feb 2018 17:37:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux)

Hello Clément,

Are we sure `mmm' always does what you expect?  Note that it gets called
with different arguments in these two cases.  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])

The lambda macro has been expanded, `mmm' not (because it had not been
known).  So `mmm' get called with the sharp-quoted lambda form, and that
returns something different:

(mmm #'(lambda nil nil)) ==> #'(lambda nil nil)

Maybe you can change `mmm' so that it handles both of these cases as you
want?  Or use a function like (defun mmm2 (f) `#',f)?


Michael.



reply via email to

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