From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: master 2c2dfbb: ; Fix some typos in doc strings and manuals Date: Sat, 24 Apr 2021 21:34:33 +0200 Message-ID: <20210424213433+0200.219828-stepnem@gmail.com> References: <20210424163058.17497.6375@vcs0.savannah.gnu.org> <20210424163100.520FC20D12@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30950"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.31.3 (https://notmuchmail.org) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 24 21:36:22 2021 Return-path: Envelope-to: ged-emacs-devel@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 1laO4k-0007uq-QI for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Apr 2021 21:36:22 +0200 Original-Received: from localhost ([::1]:54148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laO4j-0007KP-Oa for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Apr 2021 15:36:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laO38-0006rx-1N for emacs-devel@gnu.org; Sat, 24 Apr 2021 15:34:42 -0400 Original-Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:40560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1laO35-0006Zg-Gq for emacs-devel@gnu.org; Sat, 24 Apr 2021 15:34:41 -0400 Original-Received: by mail-ej1-x633.google.com with SMTP id n2so78513143ejy.7 for ; Sat, 24 Apr 2021 12:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=W/spdYUy8+kAw2pqG7zHQKdpm/vJesFhGqJBY5AvOc4=; b=cNF3gPLz/ckdPQ1ADsLj1Pz8thSGMVgEtmLei0XH2wnb+45EsYYAvFFM77l8xeblx4 ejiKMeBh/Qmndcr4JWAT7ZwYSXLAJV6ic33vkjm68MZHX4Tg6TyZlx6v4DCE2YlERJhb xmIBawRhoploADxTK4iJ2phguoVIJbyL8N21l25LX++HPsbFVPJm/IwZ1KBb8t0HGBtQ 6HSfDoPYKwGK+jBGD6Y9GwcaxXtVjSqKoJDhQ2py67CS3sE9+MuUkZP7rOYqn7pqIwfx gEP+IOVNaYWFtWjIFVYchjmE5emzHbGLkYAqHkNPMJVu51iyAEszygV38oR3e4pGzSEG K3xA== 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:in-reply-to:references :user-agent:date:message-id:mime-version; bh=W/spdYUy8+kAw2pqG7zHQKdpm/vJesFhGqJBY5AvOc4=; b=fyNSbtCpDe3qSr0iI/BExCyR5QwNqU8Wahw4wXoEe+vb2AxenAryS9RedBAjE4Ww1a IaQI2O1hz/d+wnb1XybcLX5ZNPdxcsrQHjZ+hbxR2ad4QE2pp/G6Z7otXtbqu9ahrdxf yIbpJ/kbdELPcZ7gHk2OzoAwYhpKHCa5dHKNCYMxc7Oz+EJ0hJ6gUybLUVx8mLBMTnYZ AXNefnfq+c0I6/mLBWZVoDxjar3pPK4PBaNsJc9eG23dlzifJ7qAMWY+xjr8Nr3IAkTS Luji34Q2LASjScjYcXAdXNHwwZdcRJeSzEEKIoFRnTb0bx7fmZwtgl8TBapBn+1DNRzE 2ssA== X-Gm-Message-State: AOAM530NYNN1BkH2+PtuY1jaL6stL6GcoL3KkWX5wA1OoHKZxCp+F0wz /MmSZwZmhb8U3zUid6UATzh8ERtLg84= X-Google-Smtp-Source: ABdhPJy4XlZqUyLSZOac8Yh66m8qzV9RX3lyb9aGH4vjByRGt+lO74accnjUYB5QAOgu5onOoM5CyA== X-Received: by 2002:a17:906:cc9b:: with SMTP id oq27mr10168443ejb.81.1619292875835; Sat, 24 Apr 2021 12:34:35 -0700 (PDT) Original-Received: from localhost ([185.112.167.42]) by smtp.gmail.com with ESMTPSA id i1sm9657283edt.33.2021.04.24.12.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Apr 2021 12:34:34 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=stepnem@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268341 Archived-At: --=-=-= Content-Type: text/plain On Sat, 24 Apr 2021 13:45:40 -0400 Stefan Monnier wrote: >> --- a/doc/lispref/macros.texi >> +++ b/doc/lispref/macros.texi >> @@ -486,7 +486,7 @@ variable with the same name as one of the macro arguments. Inside the >> macro body, the macro argument binding is the most local binding of this >> variable, so any references inside the form being evaluated do refer to >> it. Here is an example: >> - >> +@c FIXME with lexical-binding t this example no longer applies > > Thanks, I tried to address this problem. Thank you! I found parts of the new text a bit hard to read and/or understand, and wonder if something like the following could be an improvement. WDYT? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-doc-lispref-macros.texi-Eval-During-Expansion-Copy-e.patch >From 9d4cde283ce5deb22bc36dfee50eb20490b6ec54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Sat, 24 Apr 2021 21:19:48 +0200 Subject: [PATCH] * doc/lispref/macros.texi (Eval During Expansion): Copy edit. --- doc/lispref/macros.texi | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi index 7c090aebc866..b8df363614dd 100644 --- a/doc/lispref/macros.texi +++ b/doc/lispref/macros.texi @@ -480,15 +480,17 @@ Eval During Expansion Another problem can happen if the macro definition itself evaluates any of the macro argument expressions, such as by calling -@code{eval} (@pxref{Eval}). You have to take into account that the -context of the caller is not accessible at that time since the macro expansion -may take place long before the code is executed. Also if your macro definition -does not use @code{lexical-binding} its own variables may hide the -user's variables, if the user happens to use a -variable with the same name as one of the macro arguments. Inside the -macro body, the macro argument binding is the most local binding of this -variable, so any references inside the form being evaluated do refer to -it. Here is an example: +@code{eval} (@pxref{Eval}). You have to take into account that macro +expansion may take place long before the code is executed, when the +context of the caller (where the macro expansion will be evaluated) is +not yet accessible. + + Also, if your macro definition does not use @code{lexical-binding}, its +formal arguments may hide the user's variables of the same name. Inside +the macro body, the macro argument binding is the most local binding of +such variable, so any references inside the form being evaluated do refer +to it. Here is an example: + @example @group (defmacro foo (a) @@ -510,9 +512,9 @@ Eval During Expansion @code{x}, because @code{a} conflicts with the macro argument variable @code{a}. - Also the expansion of @code{(foo x)} above will return something -different or signal an error when the code is compiled since in that case -@code{(foo x)} is expanded during compilation whereas the execution of + Also, the expansion of @code{(foo x)} above will return something +different or signal an error when the code is compiled, since in that case +@code{(foo x)} is expanded during compilation, whereas the execution of @code{(setq x 'b)} will only take place later when the code is executed. To avoid these problems, @strong{don't evaluate an argument expression -- 2.30.2 --=-=-=--