A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00714.html below:

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Stefan Monnier Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations Date: Sun, 25 Feb 2018 22:18:01 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
> * In a new file test-macro.el, write this:
>   
>   (defmacro mmm (f)
>     `(function ,f))
>   (provide 'test-macro)
>
> * In a new file test.el, write this
>
>   (with-eval-after-load 'test-macro
>     (let ((out (mmm (lambda ()))))
>       (message "with-eval-after-load: %S" out)))
>
>   (load (expand-file-name "test-macro.el"))

This is not supposed to work: your test.el uses `mmm` before it gets
defined by the subsequent `load`.

It's true that Emacs doesn't guarantee that it will always fail to work,
but ... you get what you deserve.


        Stefan


PS: BTW, moving the `load` earlier may make it work more often but it
    still wouldn't make it right.  You'd additionally need to replace
    the `load` by `require` or to wrap it inside a `eval-when-compile`.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4