From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#52147: Eager macro-expansion is not performed in `eval-and-compile' functions Date: Sun, 28 Nov 2021 22:53:52 +0100 Message-ID: References: <87czmk7etf.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c5088d05d1e05c29" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15545"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52147@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 28 22:55:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mrS8e-0003tI-8u for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Nov 2021 22:55:12 +0100 Original-Received: from localhost ([::1]:54588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrS8d-00020U-11 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Nov 2021 16:55:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrS8U-00020I-7r for bug-gnu-emacs@gnu.org; Sun, 28 Nov 2021 16:55:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mrS8T-00042w-Vw for bug-gnu-emacs@gnu.org; Sun, 28 Nov 2021 16:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mrS8T-0005Yx-S4 for bug-gnu-emacs@gnu.org; Sun, 28 Nov 2021 16:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Nov 2021 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52147 X-GNU-PR-Package: emacs Original-Received: via spool by 52147-submit@debbugs.gnu.org id=B52147.163813645021308 (code B ref 52147); Sun, 28 Nov 2021 21:55:01 +0000 Original-Received: (at 52147) by debbugs.gnu.org; 28 Nov 2021 21:54:10 +0000 Original-Received: from localhost ([127.0.0.1]:36484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrS7e-0005Xa-7e for submit@debbugs.gnu.org; Sun, 28 Nov 2021 16:54:10 -0500 Original-Received: from mail-ed1-f54.google.com ([209.85.208.54]:40628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrS7c-0005XO-UI for 52147@debbugs.gnu.org; Sun, 28 Nov 2021 16:54:09 -0500 Original-Received: by mail-ed1-f54.google.com with SMTP id r25so63444138edq.7 for <52147@debbugs.gnu.org>; Sun, 28 Nov 2021 13:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XEviDth6bTomFGQReKp21zcZQ4XsWwnkto1xiKlf53Q=; b=ADyqeqbvbIwk1sVyIRAr8z/+KrMOf6vcEq+FcBHe5PCr5mYFaEsDClDIy8cE9A9sIj C9vbYRjbGMXgHuXAGyK9EbbET9bQxdogmJjbZOowDg+LiKAEvaLw7EpwXciC77PtU/hF hECXPVW/l/4S92HzEyMUgRi7+pTIPC2mtfy+USuU1r8BPoGykEvrRuUjOAds0zS2Uz2H ZmsKHfqL2NtfAOCDzy1n5B2U8PYL/cRm8aP4rD7S0l1JSh8ix2FAsDUERNIA0u+HI3s+ jQyOfrjL49okNL5N2yxCdh/6faxAI7Ujq9AmyVWh5CU4yqSG++w3rMyn4sww6kvi1D7f rIFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XEviDth6bTomFGQReKp21zcZQ4XsWwnkto1xiKlf53Q=; b=m7YJZ5Hykg/jwiLrbOhntP7ENNCAFwukEwE+bZI/jwXIZBJd5Iso3FfQ5ts4R33Rmu zrLJWev17XBg5jrCYAXa2cwCF+D/8vUttAPAS3bVydgkbPCAR0TowiOSFVD4ONUJpc+S luhv4M0m9Egf7ZoO66x0HKkRZTJKqCQwZE+s2L6INGdm7JEpBvDb3K8MsixBWRqCeZoW epFFoa/gIj36Okpa5RCPYwcseO209lZCkb/OB/gHdQpvRYEvmpxti4B1aE8t9uCFEY2V cbXZoViIQD0V3o+jCcv7M+pnwQTaxb9YLWQ+doKPHWvW39k6rCDqdGtNQQ5yQFuYz7pQ 4nbA== X-Gm-Message-State: AOAM530EnsQPeNuYdL2FrlNp77X5cIB1A2CpU4RwwwZ2I7vXcQrhP0n+ sOw0Kqi0NFrGbnhVtUHj1QLaYhYO5EBfVCMFMA== X-Google-Smtp-Source: ABdhPJxkYmqkgNxmmoYRDmlX1WBt7ZCpVvqJ6dBIK3utINPfDbsC72d5rMoyD01tOmEFm8PCy4MFS1cU+k93Yfwbi0k= X-Received: by 2002:a05:6402:3488:: with SMTP id v8mr68201777edc.398.1638136442847; Sun, 28 Nov 2021 13:54:02 -0800 (PST) In-Reply-To: <87czmk7etf.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220981 Archived-At: --000000000000c5088d05d1e05c29 Content-Type: text/plain; charset="UTF-8" That's what the subject says. I know that it works regardless, but the performance suffers, especially if the used macros are complex. Paul On Sun, 28 Nov 2021 at 11:30, Michael Heerdegen wrote: > Hello Paul, > > > (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. > > Is the issue you want to draw attention to that an interpreted > `eval-and-compile' form doesn't macroexpand its body? > > Michael. > --000000000000c5088d05d1e05c29 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That's what the subject says. I know that it works reg= ardless, but the performance suffers, especially if the used macros are com= plex.

Paul

On Sun, 28 Nov 2021 at 11:30, Michael He= erdegen <m= ichael_heerdegen@web.de> wrote:
Hello Paul,

> (eval-and-compile
>=C2=A0 =C2=A0(defun my-func-eac (what)
>=C2=A0 =C2=A0 =C2=A0(my-macro what)))
>
> (defun my-func-normal (what)
>=C2=A0 =C2=A0(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.

Is the issue you want to draw attention to that an interpreted
`eval-and-compile' form doesn't macroexpand its body?

Michael.
--000000000000c5088d05d1e05c29--