From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Basil Contovounesios Newsgroups: gmane.emacs.devel Subject: Re: Using the content of a dynamic variable in a macro Date: Mon, 27 Feb 2023 19:05:42 +0000 Message-ID: <87h6v753p5.fsf@tcd.ie> References: <87o7pi9m9s.fsf@cassou.me> <83fsaukruu.fsf@gnu.org> <87lekm9j2v.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26095"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Lynn Winebarger , damien@cassou.me, eliz@gnu.org, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 27 20:06:50 2023 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 1pWipl-0006cG-BW for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Feb 2023 20:06:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWios-00085n-CD; Mon, 27 Feb 2023 14:05:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWioq-0007zC-L9 for emacs-devel@gnu.org; Mon, 27 Feb 2023 14:05:52 -0500 Original-Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWiol-0004ev-3K for emacs-devel@gnu.org; Mon, 27 Feb 2023 14:05:50 -0500 Original-Received: by mail-pj1-x1035.google.com with SMTP id 6-20020a17090a190600b00237c5b6ecd7so6641534pjg.4 for ; Mon, 27 Feb 2023 11:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=CG6NemEr1sgdy1LVysrOTZMhPGszZmge0vOXgG3ugHY=; b=QiqmO/yum074bVzj7qLydKSOhApshj0Sa3I0F6Dnh9+PEzZP398wjxFcFO4IUuVpgu sZCS1q/JIyx2dblkj7By+OP9cif27bfNWJBZN50K/4WIixdBGTy8oAT4v5/Q27Q3btT6 Lnxf8fAzhP0CgTXQBfPySToAnbNeRth5+W3z5MC9qInnWjgeoUw1d5QIr+NMUVGsT2Nd PL/9Y3HNpP2SehMGEBqWotHepkg6FQ7SdB8P/wXuSLozz1oLKwGMltNa3YjupGgPLXKV L2lC9vjxyO7mLs/k8HMGwzv3qyXxJ86W0q8pJvk/kyak/nb/RYN1fj/sgXXeVL/npFJX TjzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CG6NemEr1sgdy1LVysrOTZMhPGszZmge0vOXgG3ugHY=; b=hBAbPYJgBDXOoQIMcD0HxcKF+vJJVWrVKdhX9LsMbxZc9UR/uFkBm5nak01gdc6C47 cnKIwbUNDnAEwnzz36EPJOUTqacCsNJdgli8qvaE8O4rhnAdVZDLLJryzkJ2lFzKkOIu sXFOvFQI1ijvIFu2dUOJKqn5wGcF8szRHDyUN9qzBjqypAsMT6V/qa3vBMMw78VoJ6K0 im6H826ef5TOlo4b9lB6uA960nNkj5jwjAYduCDrM8nTUTKRB72teYIoaf06VQoGnat+ 1/r8ncEVibEJ7RbdjCrn/y0F6Qo4KQpnjYEFCVlrX4cNFGyabSySbCozcm5EjR9IqouX jnZw== X-Gm-Message-State: AO0yUKULPPv5fXy9sE5N8g997LCGl3SDCzWv/EHMENmqiOl1uPm0JFrs POs0UaUUloKbEOOq+sAF8I232w== X-Google-Smtp-Source: AK7set9jkgow5LvipCSPV4sxs3KxVdO4OBDIPxvdMYJwZKVe4lzl6qlHNBLDLzQzDfIbdD6D3h1DuA== X-Received: by 2002:a17:902:eccc:b0:19b:3549:53fc with SMTP id a12-20020a170902eccc00b0019b354953fcmr30751924plh.27.1677524745599; Mon, 27 Feb 2023 11:05:45 -0800 (PST) Original-Received: from localhost ([109.78.133.215]) by smtp.gmail.com with ESMTPSA id ix1-20020a170902f80100b0019934030f46sm4990716plb.132.2023.02.27.11.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 11:05:45 -0800 (PST) In-Reply-To: (Richard Stallman's message of "Sun, 26 Feb 2023 22:24:30 -0500") Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=contovob@tcd.ie; helo=mail-pj1-x1035.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303841 Archived-At: Richard Stallman [2023-02-26 22:24 -0500] wrote: > > Lexical binding isn't the issue - the variable is global in scope. > > The issue is that when you explicitly run the byte-compiler in batch mode, > > the "defvar" expression is only compiled, not evaluated, while the defmacro > > is evaluated, and the application of the macro function is evaluated during > > compilation. > > Should we change this to evaluate defvar in batch mode? The byte-compiler avoids evaluating the defvar also in non-batch mode. So the question is how much of the code that it is compiling should the byte-compiler evaluate. We may need to reuse or possibly extend the notions of Lisp code safety we have before the byte-compiler can start evaluating arbitrary expressions. I'm not sure it's worth the complexity. -- Basil