GNU bug report logs - #52147
Eager macro-expansion is not performed in `eval-and-compile' functions

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Sat, 27 Nov 2021 19:38:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: 52147 <at> debbugs.gnu.org
Subject: bug#52147: Eager macro-expansion is not performed in `eval-and-compile' functions
Date: Sat, 27 Nov 2021 20:37:01 +0100
[Message part 1 (text/plain, inline)]
Simple code to demonstrate this:

;; -*- lexical-binding: t -*-

(defmacro my-macro (x)
  `,x)

(eval-and-compile
  (defun my-func-eac (what)
    (my-macro what)))

(defun my-func-normal (what)
  (my-macro what))

(print (symbol-function 'my-func-eac))
(print (symbol-function 'my-func-normal))

`eval-and-compile' is advertised in Elisp manual to make byte-compilation
of certain macros without prior loading possible. Looks strange that at the
same time it can worsen performance of non-byte-compiled code.

Paul
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.