unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52147: Eager macro-expansion is not performed in `eval-and-compile' functions
@ 2021-11-27 19:37 Paul Pogonyshev
  2021-11-28 10:30 ` Michael Heerdegen
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Pogonyshev @ 2021-11-27 19:37 UTC (permalink / raw)
  To: 52147

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

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

[-- Attachment #2: Type: text/html, Size: 669 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-20  9:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 19:37 bug#52147: Eager macro-expansion is not performed in `eval-and-compile' functions Paul Pogonyshev
2021-11-28 10:30 ` Michael Heerdegen
2021-11-28 21:53   ` Paul Pogonyshev
2021-11-29 15:44     ` Lars Ingebrigtsen
2021-11-29 19:14       ` Michael Heerdegen
2022-01-15 13:10         ` Lars Ingebrigtsen
2022-01-15 15:09           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-20  9:50             ` Lars Ingebrigtsen

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).