From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#40827: 28.0.50; Macroexpansion at runtime Date: Sat, 25 Apr 2020 10:49:03 -0400 Message-ID: <87sggrfwo0.fsf@gmail.com> References: <874kt8snsq.fsf@matem.unam.mx> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="106291"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Cc: 40827@debbugs.gnu.org, Stefan Monnier To: Omar =?UTF-8?Q?Antol=C3=ADn?= Camarena Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 25 16:50:18 2020 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 1jSM8H-000RWx-Sa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 16:50:17 +0200 Original-Received: from localhost ([::1]:38468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSM8G-00089v-FZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 10:50:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44504) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSM82-00089l-Hy for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 10:50:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSM82-0006z9-1o for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 10:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48660) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSM81-0006wD-L8 for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 10:50:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jSM81-0004cF-JU for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 10:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Apr 2020 14:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40827 X-GNU-PR-Package: emacs Original-Received: via spool by 40827-submit@debbugs.gnu.org id=B40827.158782616317692 (code B ref 40827); Sat, 25 Apr 2020 14:50:01 +0000 Original-Received: (at 40827) by debbugs.gnu.org; 25 Apr 2020 14:49:23 +0000 Original-Received: from localhost ([127.0.0.1]:60206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSM7E-0004b6-Pc for submit@debbugs.gnu.org; Sat, 25 Apr 2020 10:49:23 -0400 Original-Received: from mail-qt1-f172.google.com ([209.85.160.172]:36958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSM7C-0004as-2O for 40827@debbugs.gnu.org; Sat, 25 Apr 2020 10:49:11 -0400 Original-Received: by mail-qt1-f172.google.com with SMTP id k12so10487107qtm.4 for <40827@debbugs.gnu.org>; Sat, 25 Apr 2020 07:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=0hs+y67kty4QC+ZsXR0FERHyyzhXgSBrjJWfMz8MoTw=; b=dAFOFoB8O8u9FoO86Nxoej74dK2tKC5uKeBxMlDI7Tio+hNhY0DUumygirb5EYPcBM S9ZKBYZez368ULHHcw7wEFD+XUxhHinucBD11o4YZtzjpsX9sp5flQXceIUzH4TChmxy HecCWpri4mRkMXegUBFZ198hnWEP/M1SDqD8580TrKvzzi+r7f+BxLKXEZJ271bNz9rJ bGXWYLs796xywdEQ/8CIcQjdCZqsadV8qj6KARoc4ZxLPJN3hv//120lVSvSFgAxDmZ2 6WuewJeY7SZFJgtIEm9RAUckYM5On6BeusGpj5tfhheGbP6xdQQh2bVqjfZiaPpxo9ow Q0nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=0hs+y67kty4QC+ZsXR0FERHyyzhXgSBrjJWfMz8MoTw=; b=amKHv8tEsge3iZv1vqskuUw6kOSNi30d/FpviCOFrI/Z59uQBBZ9ebuvtYWIL8jCSt IB4NnyaeljLltvqiFe3DaVWpy8AH1zC+VFJxOcW2OjZ54zZgDTTNF5LhiVDth39ZcX7d UW8Oh513tWsTd7V+dE2FV/E7sk7crPTfc1BzyAudCWPCdNc0ZDEGeMZYqx49cd9pnPlV gceKhuaZeOxVF7tj2CvtmH3VW9M0RqcF1bKMGx8BPEORiSvpsW9klEE05cNLsfjvG2be Twc8ymPwIbJVKd0B5dvBgLBfdEG2EJAZZEbiHC40vbGFMBx+GLVuX88/7JqYGYArfDUo DC3Q== X-Gm-Message-State: AGi0Pubz/FJnoku3loRcbK4oqlNstguglkZ8tME2gFVRvMpG64JX5c6S WBvh5BC306GJUyVViKOSMqQ= X-Google-Smtp-Source: APiQypIQzBo5UpLQoxrOIGQLoz/OleHjdeCNRhvYtkk9VULmVHYCL5hXdbl2yVkLNHkkOdwGgcRKTw== X-Received: by 2002:ac8:4a06:: with SMTP id x6mr15251163qtq.163.1587826144510; Sat, 25 Apr 2020 07:49:04 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id i4sm1279698qkh.66.2020.04.25.07.49.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Apr 2020 07:49:03 -0700 (PDT) In-Reply-To: <874kt8snsq.fsf@matem.unam.mx> ("Omar =?UTF-8?Q?Antol=C3=ADn?= Camarena"'s message of "Fri, 24 Apr 2020 14:09:57 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 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:179007 Archived-At: Omar Antol=C3=ADn Camarena writes: > It seems that now, most of the time both the intepreter and the > byte-compiler, whether using lexical binding or not, will expand macros > at function definition time. This trick of combining an illegal (rx ... > (eval ...) ...), with lexical binding, and with eval-defun is the only > way I've found to trigger macro expansion at runtime. [...] > I discovered this during an interesting discussion on reddit, which you > can read here: > > https://www.reddit.com/r/emacs/comments/g5bat3/weekly_tipstricketc_thread= /fo362s8 [...] > (info "(elisp) Repeated Expansion") says: > >> 14.5.5 How Many Times is the Macro Expanded? > >> Occasionally problems result from the fact that a macro call is >> expanded each time it is evaluated in an interpreted function, but is >> expanded only once (during compilation) for a compiled function. If >> the macro definition has side effects, they will work differently >> depending on how many times the macro is expanded. Also further down: [...] But in interpreted execution, the macro is expanded each time the macro call runs [...] If `initialize' is interpreted, a new list `(nil)' is constructed each time `initialize' is called. (elisp "(elisp) Expansion") does mention that uncompiled macro calls (usually) also get expanded just once: Note that Emacs tries to expand macros when loading an uncompiled Lisp file. This is not always possible, but if it is, it speeds up subsequent execution. *Note How Programs Do Loading::. Ccing Stefan M, since you made the eager macroexpansion changes as far as I recall.