From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 00:07:58 2023 Received: (at submit) by debbugs.gnu.org; 5 Nov 2023 04:07:58 +0000 Received: from localhost ([127.0.0.1]:35942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzUQY-0002LE-C3 for submit@debbugs.gnu.org; Sun, 05 Nov 2023 00:07:58 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzUQU-0002Kw-9l for submit@debbugs.gnu.org; Sun, 05 Nov 2023 00:07:55 -0400 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 1qzUPg-0004IH-8v for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2023 00:07:07 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzUPe-0005il-Nt for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2023 00:07:04 -0400 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3594cb642beso13097845ab.3 for ; Sat, 04 Nov 2023 21:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699157221; x=1699762021; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=EKjfXIgQdpCly68E+BvvimVXE/ceu4w0ynNtFC8cxXU=; b=OH45708m+xz3wUv+grLWyVJgVuxcLmRAKm/gth+6+9nl1K+ssB1g+z5+F4sltA7SFL UIvGbrmzRf+0ckjuSb4Ne0iA53Mfo/JuVcLPQaXsqodAOTYKPWl12S3tn1D6kOEZwrgQ X94iRHkwtXEI4TA4OEbToLRcq9zAmWIGrdC8lmYTiJmu7mBNY2I98jCC0Q1SPG8PAh++ mNJFDMmVCDMt2fDPjFcB74AmhEKQsKVjs3sTSRJwEJfVG8oA9Z5SuU6Ek+v9JDAOWsTJ 8Ljpr/RKOSBt70g9KHREJ05cc5Wkn3+AhhtO3j1aJ6J3ffrKdE2TZAh8fJ/AeB0FAK4s ITSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699157221; x=1699762021; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EKjfXIgQdpCly68E+BvvimVXE/ceu4w0ynNtFC8cxXU=; b=MsfXYkVmPUE8IPGS4n1CdEhpTAQXtF7iInog3XhuE17QhmrbOSZiTIk5GNESbCTboc THmHl4LPZ/Bp/anjNlWGxQF1oVUMnMb6genaOCcU1aBIe8KvK2wgH6sFq/Rv35sL/xP6 AyWy6+vCeMh93R7423gDdfUjedzYLZLnX0ClYNtuzpDwavI2vVuLk715ptC7BGSaqNTj lJ+WleZlbY4McHUgMP6q3p6HEhy73ETV41kY99tbtpWAK1bwl1BgVBVWtfYjQlQnixdQ /vD7J2IKvzzSAKRVoDAqSq8YvgGGIfsXbRiRtuSYtEWWCKWKdVUS7D2qjpCMszo+a5WA Tprw== X-Gm-Message-State: AOJu0YwuPeH8lSodB641tOsCwnbI5yaO8pyQnLLRZJl5Qz7IQMv/4jLd xcIVS3QflvofSNeWvCY8u59o5fazsW5KuoNKTZIrjH50xLE= X-Google-Smtp-Source: AGHT+IFHwC39udr20nFWura46d0WUWlVmmFZnbPW30+USqvK5KPujuzVVjPtgTNipBNwiSOFSl0StUAV5LSJ7bQDH5Q= X-Received: by 2002:a92:c566:0:b0:359:6a34:904d with SMTP id b6-20020a92c566000000b003596a34904dmr7111321ilj.3.1699157220920; Sat, 04 Nov 2023 21:07:00 -0700 (PDT) MIME-Version: 1.0 From: Dave Goel Date: Sun, 5 Nov 2023 00:06:49 -0400 Message-ID: Subject: Dynamic scoping is all weird now? To: bug-gnu-emacs@gnu.org, Dave Goel Content-Type: multipart/alternative; boundary="00000000000092152706095fdef2" Received-SPF: pass client-ip=2607:f8b0:4864:20::12d; envelope-from=deego3@gmail.com; helo=mail-il1-x12d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I was playing around, checking my sanity re : dynamic scoping. I'm probably rusty, but I could swear that on older emacsen, this sort of code would print 33 ten times. On emacs -Q with debian stable (28.2). I try this Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (deego3[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (deego3[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --00000000000092152706095fdef2 Content-Type: text/plain; charset="UTF-8" I was playing around, checking my sanity re : dynamic scoping. I'm probably rusty, but I could swear that on older emacsen, this sort of code would print 33 ten times. On emacs -Q with debian stable (28.2). I try this (progn (setq lexical-binding nil) (dotimes (ii 10) (defmacro mac () `(message "%S" ,ii) (sit-for 0.1)) (let ((old_ii ii)) (setq ii 33) (mac) (setq ii old_ii) ))) Exits without error the first two times, although, strangely, i don't see any messages the second time. (I expected to see ten 33's). *(a) As in, the second time, it doesn't print 33 ten times, as we would expect.* *(b) The third time is stranger. * Let's evaluate it a third time! The third time is even weirder. The third time, it complains Debugger entered--Lisp error: (void-variable ii) (list 'message "%S" ii) (lambda nil (list 'message "%S" ii) (list 'print ii) (sit-for 0.1))() macroexpand((mac) nil) macroexp-macroexpand((mac) nil) macroexp--expand-all((mac)) macroexp--all-forms(((setq ii 33) (mac) (setq ii old_ii))) macroexp--expand-all((let ((old_ii ii)) (setq ii 33) (mac) (setq ii old_ii))) and so on. The bug(?) was reproduced on 29.1 as well - by e1f on #emacs *(c) It gets even funnier. e1f changed ii to var, but the third time, it still complained about ii, with the above error message, and not about var.* I reproduced that as well. Dave --00000000000092152706095fdef2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I was playing around, checking my sanity re = : dynamic scoping.=C2=A0=C2=A0I'm probably rusty, but I could swear tha= t on older emacsen, this sort of code would print 33 ten times.=C2=A0
=


On emacs -Q with debian stable (2= 8.2).
I try this


(progn <= br>=C2=A0 (setq lexical-binding nil)

=C2=A0 (dotimes (ii 10)
=C2= =A0 =C2=A0 (defmacro mac ()
=C2=A0 =C2=A0 =C2=A0 `(message "%S"= ; ,ii)
=C2=A0 =C2=A0 =C2=A0 (sit-for 0.1))
=C2=A0 =C2=A0 (let ((old_i= i ii))
=C2=A0 =C2=A0 =C2=A0 (setq ii 33)
=C2=A0 =C2=A0 =C2=A0 (mac)=C2=A0 =C2=A0 =C2=A0 (setq ii old_ii)
=C2=A0 =C2=A0 =C2=A0 )))

= Exits without error the first two times, although, strangely, i don't s= ee any messages the second time. (I expected to see ten 33's).

(a) As in, the second time, it doesn't print 33 ten t= imes, as we would expect.

(b) The third time is stranger.=C2= =A0
Let's evaluate it a third time! The third time is even weird= er.
The third time, it complains
Debugger entered--Li= sp error: (void-variable ii)
=C2=A0 (list 'message "%S" ii= )
=C2=A0 (lambda nil (list 'message "%S" ii) (list 'pr= int ii) (sit-for 0.1))()
=C2=A0 macroexpand((mac) nil)
=C2=A0 macroex= p-macroexpand((mac) nil)
=C2=A0 macroexp--expand-all((mac))
=C2=A0 ma= croexp--all-forms(((setq ii 33) (mac) (setq ii old_ii)))
=C2=A0 macroexp= --expand-all((let ((old_ii ii)) (setq ii 33) (mac) (setq ii old_ii)))
and so on.


The bug(?) was = reproduced on 29.1 as well - by e1f on #emacs

(c) It gets even funnier. e1f changed ii to var, but the third time, it st= ill complained about ii, with the above error message, and not about var.=C2=A0 I reproduced that as well.

Dave


=
--00000000000092152706095fdef2-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 00:10:35 2023 Received: (at submit) by debbugs.gnu.org; 5 Nov 2023 04:10:35 +0000 Received: from localhost ([127.0.0.1]:35947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzUT5-0002Pq-3J for submit@debbugs.gnu.org; Sun, 05 Nov 2023 00:10:35 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzUT2-0002PZ-HE for submit@debbugs.gnu.org; Sun, 05 Nov 2023 00:10:33 -0400 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 1qzUSM-0004iY-K1 for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2023 00:09:50 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzUSK-0005yH-Vn for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2023 00:09:50 -0400 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7a956887c20so139337739f.1 for ; Sat, 04 Nov 2023 21:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699157387; x=1699762187; darn=gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=F91Ejp7eyRQPFauVvgZ9xNlED1FssMUdBVhpifQL7k8=; b=D/plaodn4sEbXsZ+rxJmYzQ+wyZYa2pxa/jppr9XH/ypHcyDSsdlmv7UecLTHz11qL 05v/j3eHTANqpMxm3YLfrhwaEOGiC6KfV38PHdqr0/NxZtJ94n1vyFHZXYn11dApNTS0 K9Ute3D38UPQTETvcv1u9e8zhNbjbs+L97BeKUsv5Ut2Xek5rQgOJYXsmfV7rPBykyoJ 4pIJIVM7wKdBU3DeBimEwn5z+NEggEkrPQ/nFGHbRb77h8zR/sWZwG1fV3dzZ2YaS4h/ UIgv1YKQfOQObcYMGljaKAQJqX6XDqPw+zSzfgiToLl779rczy0k1lbLUneHjGT/uXwU kXFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699157387; x=1699762187; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=F91Ejp7eyRQPFauVvgZ9xNlED1FssMUdBVhpifQL7k8=; b=izebI29u7L94uzBZGUNvsXu5yEJrcD29LjEbgCQCPunsi/BiCQl/gJxk5mp1MqDUXf dPW906UiXnTCX6bl1UMO1f9Jwjxnbs/cSsbLx7CSrZC0SWUA5depi9WgEqwwWvyNKJDP eFSC9tnBBdoHaRTx56PN8/gi9Z7hj0z/8cTzXq6DDdQa75DsPFTknMEBDK4hihNeV3Ox CtVpGaYmQCDi1Yut8p4cVOsoaRxE8YA+bdOHv5TDHRowmDN+VjfcdyVXh+sDSWk+wL4m vxRs/8IEzABNWe7+PjgQWxmpUs5IMyOGW5GObY+RTHaTDr0quW/caB8XKYvzvi+2jJTJ g4yA== X-Gm-Message-State: AOJu0Yz6sPaG4flpXa6ziebCQy29ixUwxy9e6c4+2HrVGALlsNcsosLx ECkkV5WqeJwnkH9hwemClC65AxgldosvQoX/lvHxSKAz X-Google-Smtp-Source: AGHT+IFfW4IC385i9l0EFjoVUrbxjZW8My1/HL+xTGGq1dEosb6wu/n8wW+iUn6+UALt1s56hGl9DdMwIL022FZUemM= X-Received: by 2002:a92:c541:0:b0:351:e70:2cec with SMTP id a1-20020a92c541000000b003510e702cecmr33041538ilj.20.1699157387432; Sat, 04 Nov 2023 21:09:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Goel Date: Sun, 5 Nov 2023 00:09:36 -0400 Message-ID: Subject: Re: Dynamic scoping is all weird now? To: bug-gnu-emacs@gnu.org, Dave Goel Content-Type: multipart/alternative; boundary="0000000000007ed83d06095fe8f1" Received-SPF: pass client-ip=2607:f8b0:4864:20::d2c; envelope-from=deego3@gmail.com; helo=mail-io1-xd2c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I apologize.I meant to say it should print 0 to 10 the first time around because , ii should hardcode the value at the time of macro definition. But, the second and third time are so absolutely weird? Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (deego3[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (deego3[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --0000000000007ed83d06095fe8f1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I apologize.I meant to say it should print 0 to 10 the first time around because ,ii should hardcode the value at the time of macro definition. But, the second and third time are so absolutely weird? On Sun, Nov 5, 2023 at 12:06=E2=80=AFAM Dave Goel wrote: > I was playing around, checking my sanity re : dynamic scoping. I'm > probably rusty, but I could swear that on older emacsen, this sort of cod= e > would print 33 ten times. > > > On emacs -Q with debian stable (28.2). > I try this > > > (progn > (setq lexical-binding nil) > > (dotimes (ii 10) > (defmacro mac () > `(message "%S" ,ii) > (sit-for 0.1)) > (let ((old_ii ii)) > (setq ii 33) > (mac) > (setq ii old_ii) > ))) > > Exits without error the first two times, although, strangely, i don't see > any messages the second time. (I expected to see ten 33's). > > > *(a) As in, the second time, it doesn't print 33 ten times, as we would > expect.* > *(b) The third time is stranger. * > Let's evaluate it a third time! The third time is even weirder. > The third time, it complains > Debugger entered--Lisp error: (void-variable ii) > (list 'message "%S" ii) > (lambda nil (list 'message "%S" ii) (list 'print ii) (sit-for 0.1))() > macroexpand((mac) nil) > macroexp-macroexpand((mac) nil) > macroexp--expand-all((mac)) > macroexp--all-forms(((setq ii 33) (mac) (setq ii old_ii))) > macroexp--expand-all((let ((old_ii ii)) (setq ii 33) (mac) (setq ii > old_ii))) > > and so on. > > > The bug(?) was reproduced on 29.1 as well - by e1f on #emacs > > *(c) It gets even funnier. e1f changed ii to var, but the third time, it > still complained about ii, with the above error message, and not about va= r.* > I reproduced that as well. > > Dave > > > --0000000000007ed83d06095fe8f1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I apologize.I meant to say it should print 0= to 10 the first time around because ,ii should hardcode the value at the t= ime of macro definition.=C2=A0=C2=A0
But, the second and= third time are so absolutely weird?



On Sun, Nov 5, 2023 at 12:06=E2=80=AFAM Dave Goel <deego3@gmail.com> wrote:
I was playing around, checking my sanity re : dynamic = scoping.=C2=A0=C2=A0I'm probably rusty, but I could swear that on older= emacsen, this sort of code would print 33 ten times.=C2=A0


On emacs = -Q with debian stable (28.2).
I try this


(progn
=C2=A0 (setq l= exical-binding nil)

=C2=A0 (dotimes (ii 10)
=C2=A0 =C2=A0 (defmac= ro mac ()
=C2=A0 =C2=A0 =C2=A0 `(message "%S" ,ii)
=C2=A0 = =C2=A0 =C2=A0 (sit-for 0.1))
=C2=A0 =C2=A0 (let ((old_ii ii))
=C2=A0 = =C2=A0 =C2=A0 (setq ii 33)
=C2=A0 =C2=A0 =C2=A0 (mac)
=C2=A0 =C2=A0 = =C2=A0 (setq ii old_ii)
=C2=A0 =C2=A0 =C2=A0 )))

Exits without er= ror the first two times, although, strangely, i don't see any messages = the second time. (I expected to see ten 33's).

(a) As in, the second time, it doesn't print 33 ten = times, as we would expect.

(b) The third time is stranger.=C2= =A0
Let's evaluate it a third time! The third time is even weird= er.
The third time, it complains
Deb= ugger entered--Lisp error: (void-variable ii)
=C2=A0 (list 'message = "%S" ii)
=C2=A0 (lambda nil (list 'message "%S" = ii) (list 'print ii) (sit-for 0.1))()
=C2=A0 macroexpand((mac) nil)<= br>=C2=A0 macroexp-macroexpand((mac) nil)
=C2=A0 macroexp--expand-all((m= ac))
=C2=A0 macroexp--all-forms(((setq ii 33) (mac) (setq ii old_ii)))=C2=A0 macroexp--expand-all((let ((old_ii ii)) (setq ii 33) (mac) (setq i= i old_ii)))

and so on.


The bug(?) was reproduced on 29.1 as we= ll - by e1f on #emacs

(c) It= gets even funnier. e1f changed ii to var, but the third time, it still com= plained about ii, with the above error message, and not about var.=C2= =A0 I reproduced that as well.

Dave


--0000000000007ed83d06095fe8f1-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 01:05:29 2023 Received: (at 66940) by debbugs.gnu.org; 5 Nov 2023 06:05:29 +0000 Received: from localhost ([127.0.0.1]:36029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzWGH-00061A-E4 for submit@debbugs.gnu.org; Sun, 05 Nov 2023 01:05:29 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:57526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzWGF-00060u-IA for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 01:05:28 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-409299277bbso24448805e9.2 for <66940@debbugs.gnu.org>; Sat, 04 Nov 2023 23:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699164284; x=1699769084; darn=debbugs.gnu.org; h=content-transfer-encoding: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=Clkj98Xu6P5xe/L3MIlNHizZASAmvZtZofDQ2zk2TRo=; b=dU8unDMN5uEMGsFR7W4/lKJey4r09hThuq/aVq0eAUuT6tgFfK+55IC8tuCeEu9lcY s1E7Qe8zX5Mfem6RyWDMjsbSe/4hTRwhabjU0V5O1Ms50HYTDyrkD1YPzlAWHjHW8EvG 6ak1PH6432o2TAhpaOQB191PV8B4LAsJudoADbQlE3i8k2yqZj+EEwDECcuZ5+O9IzQd 5twljojqlvWrfU8VTh7oyXRoiPvJGI7g1VezocbGxu0PPfzOS5KeYXkaa3rO90gcp0QT hwEqgc4ql/uCQxkjLJw7TQzPWziYxgRgY+26P7GjeSfYew/DF0WSK+sLYxdqcJCQdtP9 fn3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699164284; x=1699769084; h=content-transfer-encoding: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=Clkj98Xu6P5xe/L3MIlNHizZASAmvZtZofDQ2zk2TRo=; b=xGqJVNbv16h/HURP2HP9tOOSupY9WsbhNbkpmhxtnV6Xud3HiNbvZbSWiWRinYAtnO YkUJXnmNYMQYQdUgeh08dB5MAxEa6OxjdE+PAMuyWuq7itxZRjhtvLCQWGsg5S7v83SC NKcDSok8owP6JW8e8UqsIvopl2rzFZWTfG4SvsVcHvAi9HCghDWEBYkgIgU2i9USkvsD RJI9znDZ+dmj/umZNn8Gc7JNTRXxkclJ4yoHAnDxSf206tnbmnB8l11DnCdsrNtCCy2/ r23XRMLflkna31PJWfIAw6/Vw0CDGCTYIL5RnibE1wod7CH3wWpS8+wUq8/uM4s/uzI9 e8BA== X-Gm-Message-State: AOJu0YzmnOLlRgF3zvOTkrRB97Io9hK0/i2eE14V5GEwgoc/iouQ2khc e2kQD6LJNH8S1Qt7OIPG1ypOqM3BZR0= X-Google-Smtp-Source: AGHT+IFUcWghxWeXchhkfJZ2R5ijW/eNAeaeccyLKoM/PXKsiEXwSWt9IjHmbu4q+x5t99mH1/5sGw== X-Received: by 2002:a05:600c:3b8f:b0:3f6:9634:c8d6 with SMTP id n15-20020a05600c3b8f00b003f69634c8d6mr22091684wms.18.1699164284454; Sat, 04 Nov 2023 23:04:44 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a9c5.dip0.t-ipconnect.de. [79.227.169.197]) by smtp.gmail.com with ESMTPSA id f16-20020a7bc8d0000000b0040684abb623sm7686694wml.24.2023.11.04.23.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 23:04:44 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Dave Goel Subject: Re: bug#66940: Dynamic scoping is all weird now? In-Reply-To: (Dave Goel's message of "Sun, 5 Nov 2023 00:09:36 -0400") References: Date: Sun, 05 Nov 2023 07:04:43 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66940 Cc: 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dave Goel writes: > On Sun, Nov 5, 2023 at 12:06=E2=80=AFAM Dave Goel wrot= e: > >> (progn >> (setq lexical-binding nil) >> >> (dotimes (ii 10) >> (defmacro mac () >> `(message "%S" ,ii) >> (sit-for 0.1)) The macro expansion of mac is what it returns, which is what sit-for returns... From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 01:59:39 2023 Received: (at 66940) by debbugs.gnu.org; 5 Nov 2023 06:59:39 +0000 Received: from localhost ([127.0.0.1]:36048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzX6h-0001a4-8g for submit@debbugs.gnu.org; Sun, 05 Nov 2023 01:59:39 -0500 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]:43183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzX6f-0001Zq-UI for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 01:59:38 -0500 Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-35957d77afcso6437205ab.0 for <66940@debbugs.gnu.org>; Sat, 04 Nov 2023 23:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699167535; x=1699772335; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZUwsnD9Tahzz4iGKnp6waspCWm3QrJnTAo6dLb95AIM=; b=DRXWmCcIoBz28XKrxjUHokcHqSWD0pbNLnqSgGCvtCRLCJIzbrxUiOD2Ka/Y9V4Wpp l3mTfcfwdL+itHDjl9TEXh4g65nnx4LMifE/39/HBPHlS3ctQ5vwQLXrEHlhgGPVM4wl mot/ASxrgL/uUyT2K3d1iWngxbqex2Wpn8gT5l7PDohKmcCmusXwrYOdZMQK6oYG1NvL Eqx+AtcIKmE6LZ+rOmn+YEn9WuCpymRSTvSA6W3b0nLFnmvMm9VP9J0e3JFTgbKk+XPk Hb+dWTDrPGxqAWAe0CiUcEDcJ7fCGbNsl26ZQZz+3excxJr03QYVbj25wdjInzB7kFLp tmog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699167535; x=1699772335; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZUwsnD9Tahzz4iGKnp6waspCWm3QrJnTAo6dLb95AIM=; b=S2JZozb334iM+WAtF+js6pEM30dWtX6cgTR0eEpHpnD8KkPEm+r9Jl7PW+fX4oyeQQ TnvMEW0JRGHDKA8oUYJ0Zk7jZKxsvSvnXt83+nHdgps77vtKreTJm7reiUkvndH2pBjf pvMHpnQcEpgQrYsvzxpXRUA/W/QvajolXxGpfZaWrSlTxMTYSOZtJVvk2692ywVlK/q9 ZrALI+LlYKP7Qx0lYbzhXo4mR/L4Ah8gYx8LQWxp3DH9xDri5DDm9z/jbm0egFL8CqmU c5ni0n+zKxqdOF3VXMdshWl1+ZTVmlsI+pBJ2k7oaL1HTN4q+EYlE/ZIqyL+qYQFS758 AnJw== X-Gm-Message-State: AOJu0Ywd+YEeqQF1BRg41a/fSXDSJoqxwfIdXM6FS0Pfwx9KOqIHcRib JINFDYL2PjkKzbNkrtxCk+C0wGSO2y8XP+/y8OA= X-Google-Smtp-Source: AGHT+IFIEqpGGZNfdeoXQ2G/w+QkGSpoCg2Vqmjx8xKznW70UqPkKjGAsYwMO5lClGzJaVfZYS7Lifcsv4ayH0oZnsA= X-Received: by 2002:a05:6e02:1ca5:b0:351:3546:dabe with SMTP id x5-20020a056e021ca500b003513546dabemr7188978ill.0.1699167535394; Sat, 04 Nov 2023 23:58:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Goel Date: Sun, 5 Nov 2023 01:58:44 -0500 Message-ID: Subject: Re: bug#66940: Dynamic scoping is all weird now? To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= , Dave Goel Content-Type: multipart/alternative; boundary="0000000000005c759e060962457b" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 66940 Cc: 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --0000000000005c759e060962457b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable got you. My macro should have been (defmacro mac() `(progn (message "%S" ,ii) (sit-for 0.1))) So, the original macro had a brain-fart basically amounted to returning nil unconditionally. In that case, why were we getting that strange error? On Sun, Nov 5, 2023 at 1:04=E2=80=AFAM Gerd M=C3=B6llmann wrote: > Dave Goel writes: > > > On Sun, Nov 5, 2023 at 12:06=E2=80=AFAM Dave Goel wr= ote: > > > >> (progn > >> (setq lexical-binding nil) > >> > >> (dotimes (ii 10) > >> (defmacro mac () > >> `(message "%S" ,ii) > >> (sit-for 0.1)) > > The macro expansion of mac is what it returns, which is what sit-for > returns... > --0000000000005c759e060962457b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
got you.=C2=A0
My macro s= hould have been


(defmacro ma= c()
=C2=A0 `(progn
=C2=A0 =C2=A0 =C2=A0(message "%S" ,ii)<= br>=C2=A0 =C2=A0 =C2=A0(sit-for 0.1)))

So, the original macro had a brain-fart basically amounted to re= turning nil unconditionally.
In that case, why were we g= etting that strange error?=C2=A0



On Sun, Nov 5, 2023 at 1:04=E2=80=AFAM Gerd M=C3=B6llmann <gerd.moellmann@gmail.com> = wrote:
Dave Goel= <deego3@gmail.com= > writes:

> On Sun, Nov 5, 2023 at 12:06=E2=80=AFAM Dave Goel <deego3@gmail.com> wrote:
>
>> (progn
>>=C2=A0 =C2=A0(setq lexical-binding nil)
>>
>>=C2=A0 =C2=A0(dotimes (ii 10)
>>=C2=A0 =C2=A0 =C2=A0(defmacro mac ()
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0`(message "%S" ,ii)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0(sit-for 0.1))

The macro expansion of mac is what it returns, which is what sit-for
returns...
--0000000000005c759e060962457b-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 02:26:33 2023 Received: (at 66940) by debbugs.gnu.org; 5 Nov 2023 07:26:33 +0000 Received: from localhost ([127.0.0.1]:36054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzXWi-0002G8-PS for submit@debbugs.gnu.org; Sun, 05 Nov 2023 02:26:33 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:52249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzXWg-0002Fu-Qx for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 02:26:31 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-408382da7f0so26013075e9.0 for <66940@debbugs.gnu.org>; Sun, 05 Nov 2023 00:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699169147; x=1699773947; darn=debbugs.gnu.org; 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=nWzShMRrUjgrx2yyvKKJ014se0YnddmaIpHCqCXir+E=; b=ZHZV8h79a32rFOgV5Gypgj3cUhEQNb4OmbhzTS+0obpNoP7f2zox9H+9cy6LYD0C5i 6WZdkr5nJXWXbGf/HpjOmzvCTklPWYjKx1L9Ks7rtq8C3wEdtUD3kIMhchIZRr/qv/Cl dgEyoArJMOrj6hb0L+kk85yhKPb+9JgQMj3b0248SDUXyDe9uGmJ8j3wIDSH+bk0sT1d sl8S/UsXxRfewdCm7Rh+Ojz1hf/Q5CbEj1O9xKpsf/sZOY89l0iSiCYny2edTrDpVe0l u1Hsy172bzXE6llTyqO9edCsma/nRvYoEPsq7JJTn4kurw74LgVI1K7SdfD9FNB72pbm ungg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699169147; x=1699773947; 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=nWzShMRrUjgrx2yyvKKJ014se0YnddmaIpHCqCXir+E=; b=S2m050jgEGSg+7nUYiLBr1hf+uOQGDb/jKpnzMtPIWuKX5HuYdhOEOB67WwltbYeD3 QCPSg0zDQcHJ3U9mUx/Upr854EAHFEqNCw6VgowNoKRgquIxXyfKpBqJaBv+rhnCju4m itGssg8RAtW1RJuHFmQfHd1uwHFdsVOmI2tVp/C8OLNDsdbgi0VRCueDMe4FcGswbvJy s0wlJAsvlHjSKvxbGNh19HlbBl0ajQMY+RUUOEzWPZgHOuNkYoJUgc3QgIru4c37i582 9ocu3YyHHWCa9bZHEo7BR4Jhp/F6h3jxiu+KLiWnYLcDqq8D8fyeIN2kPd7bTx2cq9xX qF4g== X-Gm-Message-State: AOJu0YzZr+emhyh0hXsPcedVWhnhWZO9YWyEZ4xMp4vb9b7AW38+w7na Dfj3RjfyhxSsG3ImCi1aHTHUQ+ECWa4= X-Google-Smtp-Source: AGHT+IF3Bw+om6RtGVi2shMbNZsVYtu+Xe+p50ASMfjSvx+AYIRomaFPZaRUyepP9QHHlNjUMlQ7pg== X-Received: by 2002:a05:600c:474f:b0:405:359a:c965 with SMTP id w15-20020a05600c474f00b00405359ac965mr21687223wmo.4.1699169147013; Sun, 05 Nov 2023 00:25:47 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a9c5.dip0.t-ipconnect.de. [79.227.169.197]) by smtp.gmail.com with ESMTPSA id p22-20020a05600c419600b00401d8181f8bsm7875680wmh.25.2023.11.05.00.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 00:25:46 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Dave Goel Subject: Re: bug#66940: Dynamic scoping is all weird now? In-Reply-To: (Dave Goel's message of "Sun, 5 Nov 2023 01:58:44 -0500") References: Date: Sun, 05 Nov 2023 08:25:45 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66940 Cc: 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dave Goel writes: > (defmacro mac() > `(progn > (message "%S" ,ii) > (sit-for 0.1))) > > So, the original macro had a brain-fart basically amounted to returning nil > unconditionally. > In that case, why were we getting that strange error? Don't know exactly what the "strage error" refers to, but maybe a (pp (macrexpand-all ...)) helps? In this case, the result is "(progn (setq lexical-binding nil) (let ((upper-bound 10) (counter 0)) (while (< counter upper-bound) (let ((ii counter)) (defalias 'mac (cons 'macro #'(lambda nil (list 'message \"%S\" ii) (sit-for 0.1)))) (let ((old_ii ii)) (setq ii 33) (mac) (setq ii old_ii))) (setq counter (1+ counter))))) One things that gets kind of more obvious is that defmacro is something "global" in the sense that it sets mac's symbol function. You could moved the defmacro out of the progn somewhere else. Does that help? From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 03:12:56 2023 Received: (at 66940) by debbugs.gnu.org; 5 Nov 2023 08:12:56 +0000 Received: from localhost ([127.0.0.1]:36067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzYFc-0003Wx-70 for submit@debbugs.gnu.org; Sun, 05 Nov 2023 03:12:56 -0500 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]:59797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzYFa-0003Wj-0x for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 03:12:54 -0500 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3594cb642beso13518675ab.3 for <66940@debbugs.gnu.org>; Sun, 05 Nov 2023 01:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699171931; x=1699776731; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+aXDdIY0Y/21sbSaw8QlFgLIgts4U/tDnRhXW6/lng4=; b=ONUxG4rOKo97Axdwa+PWZEQmiYYxiPHqCVUpBUy1PinA3+kXA+UWntTjRFK0iIPUdS NgVqLpCl3tr2JtOjC+MFu4tvDWu9MeCajYHylm72V1F2au4anilGB98ZgiTInqJqo/75 KwfroP7VhunIT6rLHWj3yI35VDioJmCn/xIdGhiAZJXJz3u0WLALpLEUi1tBlDU2ir0q 32ziOjLPOI6llJNyBLa4Ep2W7KUfCH1+vtKdmJPILsduk+p1aS2PCMD65889rYX+LUvt lEn1pm77r+QNYGr+RyclwcASdLbfBVua/YSY1jrEcRwKQihxBuuLN+oTwD49RTDw4qdU 5D5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699171931; x=1699776731; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+aXDdIY0Y/21sbSaw8QlFgLIgts4U/tDnRhXW6/lng4=; b=Ty4U7DOx5yj/TOMjUS4jWfkdWm+wfKY/LCU2cyelMThy7/tCAB/kgeJS0gcAMtxPwY bxsdFfFt5v6Vb4pG1mWkZryD9mKWA+LNHhzKbjBZY3ZZHovUtlFDOLnk8HpgglqpjHgj oDFcSjkKpZIqKak7OLpK84vuujwOMGHaXeJn1ReeDshfDcrcZq4TLPVpVC1EjvYrwTZu DOTesP2/tkt1uoaV4GYPhsGECyk2YnENdF/hrgt/pvZcH9JAE9rYqM9w5oHMMMjAqVz/ QhFM52/DXwS3q3Fu+WYioXTpbqwmeKZsrDkgs8OjY6KROTrw6ov1eESKN1WqwkFpiF+9 z09w== X-Gm-Message-State: AOJu0YwlSMNXvrRefuENtUXOemR+NYpGeQL2W/WXzkhZHXMGOvtPUxLo zEQEbTMMg3aiakovL9kg80Jdt3rM0SpoWEM7sko= X-Google-Smtp-Source: AGHT+IERu4MmKiahzkGPAK8fPZnkB/XxRjajZ3JAtmfKFn3D62tMXzWleJVG/Yb4HDjFZPIWSAzdWt64ezdO6IQbGwo= X-Received: by 2002:a05:6e02:1251:b0:359:506c:8b05 with SMTP id j17-20020a056e02125100b00359506c8b05mr8955944ilq.20.1699171931526; Sun, 05 Nov 2023 01:12:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Goel Date: Sun, 5 Nov 2023 03:12:00 -0500 Message-ID: Subject: Re: bug#66940: Dynamic scoping is all weird now? To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= , Dave Goel Content-Type: multipart/alternative; boundary="000000000000641b0f0609634bed" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 66940 Cc: 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --000000000000641b0f0609634bed Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Nov 5, 2023 at 2:25=E2=80=AFAM Gerd M=C3=B6llmann wrote: > > Don't know exactly what the "strage error" refers to > My original code may not make logical sense, but it was valid code? It shouldn't have produced the errors described in sections (b) and (c) of the bug report? Those are both emacs bugs in (b) and (c)? --000000000000641b0f0609634bed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, No= v 5, 2023 at 2:25=E2=80=AFAM Gerd M=C3=B6llmann <gerd.moellmann@gmail.com> wrote:

Don't know exactly what the "strage error" refers to

My original cod= e may not make logical sense, but it was valid code?

It shouldn'= ;t have produced the errors described in sections (b) and (c) of the bug re= port?

Those are both emacs bugs in (b) = and (c)?


=C2=A0
--000000000000641b0f0609634bed-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 03:40:41 2023 Received: (at 66940) by debbugs.gnu.org; 5 Nov 2023 08:40:41 +0000 Received: from localhost ([127.0.0.1]:36088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzYgT-0004Ct-Ew for submit@debbugs.gnu.org; Sun, 05 Nov 2023 03:40:41 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:59435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzYgR-0004Cc-9G for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 03:40:40 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c515527310so48146991fa.2 for <66940@debbugs.gnu.org>; Sun, 05 Nov 2023 01:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699173596; x=1699778396; darn=debbugs.gnu.org; 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=95CGFSjmNvhqIrMDfd2eKchUBRS/+AgpVOVd7KP3Iz8=; b=aq4nSeUIBOToHcQrHo2eLM23etRgettFzTaDqM39HPMPplt9krtzMgfinEvQ4fIJ4J vFTmhX/7AJcnmhWX57Ox06H4/fQX5t892KvmUABsUf3fNo8wY1k81E55ita6nBY/10my ee7J/Z5SgIkKZ1l0LtAnUmxd+rlV8H4qHUn8A2j/8T2qlFHpebwc0QcTafehWpSOv6XB rIWQ1JdaeTvDbXmi7614E+rf+s6W0kw9mohJPr7EZQ5fBS6VhcmG+HZHxn7PO//A60OP RCIpbAhVECTh4NvDb4rtcMddoPl0IN/xbbCvWv15znG3jvI6k+9dIfV//LZo7LkQ5TyU g0Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699173596; x=1699778396; 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=95CGFSjmNvhqIrMDfd2eKchUBRS/+AgpVOVd7KP3Iz8=; b=qrb7NOcYeylCBh0mfFW5ZmqRAkzQQ+CA857mH/Fu80c2YsUT1ZQO4FKaHkSFntnp28 OAt/UEbQ/EWy7hWlsgkgN8W6ZoEb+S5Nmr1Fcv08sEiI9aqJfe0pmYxGYRmVJHmQoDyT klVLRlXcyaxT1Up6V+JAceZSWQZpHCeiLUJo5Sk5kI+OhF4uEAEk5/7koXY4zUO+ewlm 4yZFrZKuGR+Zi//nBrfoIIUZtwLBLPxdnjcNHr+wzFJ8vdo9JGaB35BFkq/NWwogv90i 67NCTj7iJtTGKco8yWYIfg4piGbfG/59NzBgDgqwBUK2ljdE9vdjl32gkQb9Xz7CHJgS wl4g== X-Gm-Message-State: AOJu0YzvHlvv74Rsu2wln0PY/TjOx5uV+2EAXjAjygng+regK+9JQy0C iBqj1xJDkK1HDji5q/gNPKGannCIvuE= X-Google-Smtp-Source: AGHT+IGM1mCGTORbIkYMOD5W71TQaddd0MLyUqRpzeG/ETWhEIMjUzQ+G36gxKhirmKm27Awz8N8Cg== X-Received: by 2002:a2e:a98e:0:b0:2bc:c4af:36b9 with SMTP id x14-20020a2ea98e000000b002bcc4af36b9mr24248567ljq.52.1699173595875; Sun, 05 Nov 2023 01:39:55 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a9c5.dip0.t-ipconnect.de. [79.227.169.197]) by smtp.gmail.com with ESMTPSA id h9-20020a05600c350900b004083729fc14sm8286347wmq.20.2023.11.05.01.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 01:39:55 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Dave Goel Subject: Re: bug#66940: Dynamic scoping is all weird now? In-Reply-To: (Dave Goel's message of "Sun, 5 Nov 2023 03:12:00 -0500") References: Date: Sun, 05 Nov 2023 09:39:54 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66940 Cc: 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dave Goel writes: >> >> Don't know exactly what the "strage error" refers to >> > > My original code may not make logical sense, but it was valid code? > > It shouldn't have produced the errors described in sections (b) and (c) of > the bug report? > > Those are both emacs bugs in (b) and (c)? I must admit that I couldn't follow (c). In case (b) is don't see a bug. Maybe you could write some easier to understand code which demonstates what you mean? From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 14:07:59 2023 Received: (at 66940) by debbugs.gnu.org; 5 Nov 2023 19:07:59 +0000 Received: from localhost ([127.0.0.1]:38233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qziTX-00049Q-DB for submit@debbugs.gnu.org; Sun, 05 Nov 2023 14:07:59 -0500 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:53302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qziTU-000498-EJ for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 14:07:57 -0500 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-35742cbb670so15289555ab.2 for <66940@debbugs.gnu.org>; Sun, 05 Nov 2023 11:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699211234; x=1699816034; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FFWstyAuJ5TW6otKw5dN7Hof5Y+EzffBZ4aoLhSnMU8=; b=XDM9FAk4wMDvHfMrWus50/2ZSwfoWSLdH4N3q9XHaRGgmASiSN6iJ6R4Cv+ij+t6Sx dJhcmK+uhuujUa+HI4GRUzOo3uCVqPx82S4qeU3i9cs4IpuLvBEg4MQhvjOzOkVzj2FB kTpI+RPoUp7HNAeBThLPchx2DL1oq1wo9R/WzhdNVlKOHfTJcb9dyRC4vA7SehxgRvHf J2iLSkOV7pC/mg9M1L3h4g2R/vLem1Vx9oBvQKASZsr205n8e1n9YwIC7/HSdeq/7T6K yHHlpPU0YjvbsrixlzTbkKosLb2YKw83AamJ+I3oDXjxaHDNT17vRFII0bdrsfAaU44J 4PEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699211234; x=1699816034; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FFWstyAuJ5TW6otKw5dN7Hof5Y+EzffBZ4aoLhSnMU8=; b=Rsy3VZPleJPza7uMhk7J5wjISEJSFQKeZOxIEIu9EZFgwgAhT1vmuYj93opiCx7TR2 F4uRvrj3HvSQGySWdo1h4+DX5yYNaxuE6Ff29dzqm5duI7Xqo3I6rnBfRApsjF3eJ99d VspjPo2kUZBkDmo4e2lZWwREMZusXRqopoJq1JvFaNBNqRs8uqc4fZojP2wNCc9x2O50 WC1qAb9iFs83d9nuG+N50qdHbo8GomcOHlvwewFGx5qy0PEI52mqKfH65arqLaSr8SXA 6DZV/9WYUA/XFkHoP+Rp1SoeZjFRoLNqQ60MwtWMlRmVgcpSUD3VfhRlRl+UYoDal6E4 t/Mg== X-Gm-Message-State: AOJu0Yx7tYdWT3hWKepl3iyOdUUNMX4R8nxUNpzNrnJEjTguYqg6yink Pj4v7zj9DkJEuAUeUxexuAtwRhFbPhwDcfQmGIw= X-Google-Smtp-Source: AGHT+IHgFaoggal1xTrVxgNKNMx2HLdttVE3UvHd0nrBI0tFDeiCHnhX4QfOKvoCWqUT/KaxKulNsSmC545hgvs4+6s= X-Received: by 2002:a05:6e02:12c6:b0:351:22a2:bbe7 with SMTP id i6-20020a056e0212c600b0035122a2bbe7mr34320117ilm.0.1699211233745; Sun, 05 Nov 2023 11:07:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Goel Date: Sun, 5 Nov 2023 14:07:02 -0500 Message-ID: Subject: Re: bug#66940: Dynamic scoping is all weird now? To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= Content-Type: multipart/alternative; boundary="000000000000fc5ff006096c7152" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 66940 Cc: 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --000000000000fc5ff006096c7152 Content-Type: text/plain; charset="UTF-8" Gerd, Ok. I hope this bugreport is clearer - Here's some code. The variable ii is clearly set every time mac was defined OR called. backquote should expand, and mac should have read its content as (list 'message "%S" ii). (progn (setq lexical-binding nil) (dotimes (ii 10) (defmacro mac () `(message "%S" ,ii) ) (let ((old_ii ii)) (setq ii 33) (mac) (setq ii old_ii) ))) You eval this code once. It works. You eval this again. It works. The third time, though, it lands you in the debugger. The very same code. Why the third time? And, why the debugger? ii is well set every time it is used. That was bug (b). That's clearly an emacs bug? Here's (c) - The third time, change every "ii" to "var" ,and change every "old_ii" to "old_var". And, evaluate it. We still get the very same error, but the error involves ii, not var. The code we are defining and eval'ing has no "ii" whatsoever. It should have forgotten the old mac that involved ii. We defined a new mac involving "var." > > --000000000000fc5ff006096c7152 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Gerd,
<= br>Ok.

I hope this bugreport is clearer -

Here's some co= de.

The variable ii is clearly set every time mac was defined OR cal= led.

backquote should expand, and mac should have read its content a= s (list 'message "%S" ii).




(progn
=C2= =A0 (setq lexical-binding nil)

=C2=A0 (dotimes (ii 10)
=C2=A0 =C2= =A0 (defmacro mac ()
=C2=A0 =C2=A0 =C2=A0 `(message "%S" ,ii)<= br>=C2=A0 =C2=A0 =C2=A0 )
=C2=A0 =C2=A0 (let
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 ((old_ii ii))
=C2=A0 =C2=A0 =C2=A0 (setq ii 33)
=C2=A0 =C2=A0 = =C2=A0 (mac)
=C2=A0 =C2=A0 =C2=A0 (setq ii old_ii)
=C2=A0 =C2=A0 =C2= =A0 )))


You eval this code once. It works.
You eval this agai= n. It works.
The third time, though, it lands you in the debugger. The v= ery same code. Why the third time? And, why the debugger?=C2=A0 ii is well = set every time it is used.

That was bug (b). That's clearly an e= macs bug?


Here's (c) -

The third time, change every= "ii" to "var" ,and change every "old_ii" to = "old_var".
And, evaluate it.
We still get the very same err= or, but the error involves ii, not var. The code we are defining and eval&#= 39;ing has no "ii" whatsoever. It should have forgotten the old m= ac that involved ii. We defined a new mac involving "var."



--000000000000fc5ff006096c7152-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 15:22:23 2023 Received: (at 66940) by debbugs.gnu.org; 5 Nov 2023 20:22:23 +0000 Received: from localhost ([127.0.0.1]:38252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzjdW-000655-Iu for submit@debbugs.gnu.org; Sun, 05 Nov 2023 15:22:22 -0500 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]:56628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzjdU-00064p-2j for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 15:22:21 -0500 Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-3575287211bso13619065ab.1 for <66940@debbugs.gnu.org>; Sun, 05 Nov 2023 12:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699215697; x=1699820497; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hYQd+clV/FzIQ396akG/KIUgNRTH9XXG6cxXom5ZP5c=; b=eDD7ZHK3GTkFVOd1KLtmNnBE4Hh1Y6AH6vNVG9bxUY9zzU5on0hzjuv8mJC12VwUSr CaY4KGehlznOOTZ2jgOjJIiaMwR9tLaxPK1u/Zla13mHzoRAtrXxefPFkLbrveLmY3vw 8L1RDn6SeclX9EFixZkkC44mn0m1lhDNLdsgK6NSlxHG3izZiwVSWE4lCfLrSeeClbsw 4VY6yuaWXmyIk/hJQyPhNSvZGGmMlofQzkvZn0tsI43wsLfZpSIAuXuVgWkzY/7cpF3n bRkEqFlAyqa1jHz9urQ4ENPuMDSg5Wmn9qLSyXOTG0sNB4M3w0c6yd5n/jvX5nDyH2u0 TfKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699215697; x=1699820497; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hYQd+clV/FzIQ396akG/KIUgNRTH9XXG6cxXom5ZP5c=; b=MWVdE0TkoHcOAaVJziXoH1DwnBbsTPtQXfmFUzEgtKab1Plc4gDl5VuQVYx6iU3IGr Wa2qUBC+ZsiNd8KLgIl5HR5/qmHC/Z8te7LI4OSLrh9UlbRHW8mhp5rhj6eosqy3PJvw cPEZbcP6Apg7UoEcXMxYvSacmj7pd5W0WgyzHV9BwFYnNmje3f7IPNirJqJp+mPMlFM4 ZALiBTBaAa8x0wrXfvcWo9jKqWpoyOwk5mMEC/rjqjLXHvNjEtLMlA2OzN92bfdhfpHy Eqm0F6kTIYz3NVJ+fAzRVciqJB+u/t5zSnf9N9owjyKGm91crfT96ty1v8DRtnXvGy9c N6FQ== X-Gm-Message-State: AOJu0Yw66z+pTo2aB6FwqRCHnCq+1hpEYpprOtbC9wZkRNENmMXT3q/r E0lVLMkUTbyaFaiEb54kYv8MnCTASsmXxCAgV0250WAyJSU= X-Google-Smtp-Source: AGHT+IEGEXwXkGu/DR7zcUGUJ2Gp2UwRNFLdUwNCiip681bccUJS7UqQRoRMAuxtcSvzVMjYtZfGNbkrYc9l1zbLIoY= X-Received: by 2002:a92:c26a:0:b0:357:a337:b12f with SMTP id h10-20020a92c26a000000b00357a337b12fmr35017288ild.12.1699215697002; Sun, 05 Nov 2023 12:21:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Goel Date: Sun, 5 Nov 2023 15:21:25 -0500 Message-ID: Subject: Re: bug#66940: Dynamic scoping is all weird now? To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= , Dave Goel Content-Type: multipart/alternative; boundary="00000000000004485c06096d7c22" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 66940 Cc: 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --00000000000004485c06096d7c22 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Here's the simplest MRE I have so far - (progn (setq lexical-binding nil) (let ((ii 1)) (defmacro mac () `(message "%S" ,ii) ) (mac))) Eval it three times, using C-x C-e. Error on the third time. (Following the prior response, I figured I will discuss on devel first to confirm before officially reporting it, but was kinda directed back here.) On Sun, Nov 5, 2023 at 2:07=E2=80=AFPM Dave Goel wrote: > Gerd, > > Ok. > > I hope this bugreport is clearer - > > Here's some code. > > The variable ii is clearly set every time mac was defined OR called. > > backquote should expand, and mac should have read its content as (list > 'message "%S" ii). > > > > > (progn > (setq lexical-binding nil) > > (dotimes (ii 10) > (defmacro mac () > `(message "%S" ,ii) > ) > (let > ((old_ii ii)) > (setq ii 33) > (mac) > (setq ii old_ii) > ))) > > > You eval this code once. It works. > You eval this again. It works. > The third time, though, it lands you in the debugger. The very same code. > Why the third time? And, why the debugger? ii is well set every time it = is > used. > > That was bug (b). That's clearly an emacs bug? > > > Here's (c) - > > The third time, change every "ii" to "var" ,and change every "old_ii" to > "old_var". > And, evaluate it. > We still get the very same error, but the error involves ii, not var. The > code we are defining and eval'ing has no "ii" whatsoever. It should have > forgotten the old mac that involved ii. We defined a new mac involving > "var." > > >> >> --00000000000004485c06096d7c22 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here's the simplest MRE I have so far - =

(progn
=C2=A0 (setq lexical-binding nil)

=C2=A0 (let ((ii= 1))
=C2=A0 =C2=A0 (defmacro mac ()
=C2=A0 =C2=A0 =C2=A0 `(message &q= uot;%S" ,ii)
=C2=A0 =C2=A0 =C2=A0 )
=C2=A0 =C2=A0 (mac)))

Eval it three times, using C-x C-e.
Error on the third time.
<= div class=3D"gmail_default" style=3D"font-family:trebuchet ms,sans-serif;co= lor:#0000ff">
(Following the=C2=A0prior response, I = figured I will discuss on devel first to confirm before officially reportin= g it, but was kinda directed back here.)



On Sun, Nov 5, 2023 at 2:07=E2=80=AFPM Dave Goel <deego3@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">
Gerd,

Ok.

I hope this= bugreport is clearer -

Here's some code.

The variable i= i is clearly set every time mac was defined OR called.

backquote sho= uld expand, and mac should have read its content as (list 'message &quo= t;%S" ii).




(progn
=C2=A0 (setq lexical-binding n= il)

=C2=A0 (dotimes (ii 10)
=C2=A0 =C2=A0 (defmacro mac ()
=C2= =A0 =C2=A0 =C2=A0 `(message "%S" ,ii)
=C2=A0 =C2=A0 =C2=A0 )=C2=A0 =C2=A0 (let
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((old_ii ii))
=C2= =A0 =C2=A0 =C2=A0 (setq ii 33)
=C2=A0 =C2=A0 =C2=A0 (mac)
=C2=A0 =C2= =A0 =C2=A0 (setq ii old_ii)
=C2=A0 =C2=A0 =C2=A0 )))


You eval= this code once. It works.
You eval this again. It works.
The third t= ime, though, it lands you in the debugger. The very same code. Why the thir= d time? And, why the debugger?=C2=A0 ii is well set every time it is used.<= br>
That was bug (b). That's clearly an emacs bug?


Here&= #39;s (c) -

The third time, change every "ii" to "va= r" ,and change every "old_ii" to "old_var".
And= , evaluate it.
We still get the very same error, but the error involves = ii, not var. The code we are defining and eval'ing has no "ii"= ; whatsoever. It should have forgotten the old mac that involved ii. We def= ined a new mac involving "var."



--00000000000004485c06096d7c22-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 20:53:01 2023 Received: (at 66940) by debbugs.gnu.org; 6 Nov 2023 01:53:01 +0000 Received: from localhost ([127.0.0.1]:38457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzonV-0005Kb-2P for submit@debbugs.gnu.org; Sun, 05 Nov 2023 20:53:01 -0500 Received: from mout.web.de ([212.227.15.3]:53313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzonT-0005KO-3q for 66940@debbugs.gnu.org; Sun, 05 Nov 2023 20:52:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1699235535; x=1699840335; i=michael_heerdegen@web.de; bh=ZVArgQ73ZvqJQHiGQ/srZAcyDlvjKl0zuVMYXmkRDVc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=FMt++QQcTxc9jF2QNGoCYZyAUYBO+yyE13ANLJ+Du5NaZ8I62qxzubBhOYElcwkm rfWmrYKiRIvdGOXzC+6QEhfyT1j4TbhM5mv0cZY1BGcIkNvBqyUucNmmD/w9m1OIf TRapnnDaNvaO1nSH81WEKa8X4gqUbO5iEC2TaeY+lMFMF5iY9s5EIooL6VBeVrUcq rOikMjK/v51drlt99RExrje5nJy69/6BJj+iAWbjXq5OQL9dNJAJeZcmEpJ5feUq8 wBMwhhnapNIVjpa+eLD6JZrOQanui+IQGqCdEROu+vxxcA9xZQlD0zdFAOL0m6UpC +klc2bQ9t5grMQmw3A== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.59.210.159]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N4621-1rQawp3ckz-00zlRg; Mon, 06 Nov 2023 02:52:14 +0100 From: Michael Heerdegen To: Dave Goel Subject: Re: bug#66940: Dynamic scoping is all weird now? In-Reply-To: (Dave Goel's message of "Sun, 5 Nov 2023 14:07:02 -0500") References: Date: Mon, 06 Nov 2023 02:52:26 +0100 Message-ID: <87ttpzhcmd.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:K/0vqjO6ZUuCM4dZ52QjfUWBz5j5LtvCjiTYLE8//W3FX3ZooK7 W/MRZPFZV4L8g3jLbdLUutgmWAwxE60xI2KfOzpjJqlNYGVRDUD/37zPjCtONf/ApIKJiTJ FTU7J7tx8OULgNK+jkqByO/zolRNLZ7hEEHG8SizaN1+X9rmKldkJxxTlD9yUMYUaEA5hLo VfNLy7n5AetNO/bcm2IoA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:/uE/vQVgEQ8=;ngNlaRDERZ08hjZtEngLgv0wk/k CbJ362GMgwyoN9U2y+/IkHgtwvtSaIpH8iF7EFn02O7v2kS5ouJ7al2z4NkXO3F9VukOAl9C+ Jy5z3eHIMrXxUxmm1wwSpR0PZ4Hi9KKj6sWguYAk/6u3GlQHwzRQesY7dAeoQhcfJfPyFjBVf TIWp4G06lLWow7aY84ZBDnymkYOsUaYCJA5Q3P388kYUTk93ERQMnnRWeKPa11kPRdGAHuTpc phuFJzUReEFLAvwiI9nmOgeaslqdXPBnP80q5bVlcXZGiFJAMTUiU5FaBkJ0TorprxfhqF4oV B6e3+dGDKVgFNIhaF0WKU+Dt7OF0x4LWlse5swS2arXrT7bFc23irmP2kZd1JtxagNNxJAurT oZeLsTHfHYGDr5uNoFTfe2FtPgq1hNRxYF1Tm933CrcwrobDCMorP9sYnFGEovKi9IaHVfMBo tzEzVcNUAmjED+DTt5ubb+LinuUasE0Ig+KPZff/sBtcmV5pQszzZwriSYYyPIrythdHMy68f Rke6ICOC04AjKOxSHT1iR+mByKpvW4Oqv/dYNM4gD5jQiu082Jctl4PAtHynxR2fV5vOhJ1ag aCNjoFXbrLf+NX29O3ALucI0jZyPEGgXz6TxLCnVTA/Bs4/WHQG4L5GNThazluk2Nue7hd9IN m/HWa5jijXV0TrZLyxlRUraBfw8c/xZFNRKJLUYhiAtdiLQm7ZMcLES9KIMB9/qtIOW/HGN+9 uXM1l8sR8RWcd6+1F9luePsgz3MBYi6rs4XMbBRQS2TVZwSqMWcqBbPC4mQbISYCQtCx5ZVCn P49KwVYFLF3oo4RbeOTyxnboVnJMcF8TlzT34jvbjtFF+J8XxHhi7lH84QTF0X6G4BtePb3GA 9+SopOSTPwuGZxICpkHl9O+97trpvFJurnt6c1qNUG07uuPMX4DHMkI136UWI9aFay6QUtfJv aq4Vtr/jQrm3acnEq7SBEAW2yHA= Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66940 Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= , 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Dave Goel writes: > (progn > (setq lexical-binding nil) > > (dotimes (ii 10) > (defmacro mac () > `(message "%S" ,ii) > ) > (let > ((old_ii ii)) > (setq ii 33) > (mac) > (setq ii old_ii) > ))) This code has two problems: (1) Setting `lexical-binding' in the middle of an evaluation does not work as you think. Either you eval en expression (like the above) using lexical binding or dynamical binding. If you change `lexical-binding' in the middle you might get unexpected behavior. Please set the binding mode only in the file header, not in the code. In the extremely rare cases where you really must evaluate an expression using the other binding mode use `eval' with an appropriate second argument. (2) Macro expansion does not work as you think. Most of the time macros are expanded _once_ in the complete expression and then the result is evaluated. When you redefine a macro in the middle of evaluating code using it, most of the time this will not have an effect because the macro had already been expanded in the following code. > You eval this code once. It works. > You eval this again. It works. > The third time, though, it lands you in the debugger. The very same > code. Why the third time? And, why the debugger? ii is well set every > time it is used. It's not surprising. The first time you start evaluating the expression using lexical binding. Because your code sets lexical-binding to nil, the second time you actually use dynamical binding completely. The third run fails because when `mac' is expanded a variable `ii' is undefined on top-level, so macroexpansion fails. The second run is different: because the first run had used lexical-binding (more or less completely, since you started the interpreter using lexical-binding mode), the macroexpander of `mac' is actually a closure that inherited the value of `ii' from the last iteration of the first run. Because of that the second run succeeds. The second run redefines `mac' so that its reference to `ii' now means the dynamical global variable, which doesn't exist. So, I think everything indeed perfectly works as expected here. Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 01:26:09 2023 Received: (at 66940) by debbugs.gnu.org; 6 Nov 2023 06:26:09 +0000 Received: from localhost ([127.0.0.1]:38544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzt3o-0005N3-Nz for submit@debbugs.gnu.org; Mon, 06 Nov 2023 01:26:08 -0500 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:56748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzt3l-0005MY-Ei for 66940@debbugs.gnu.org; Mon, 06 Nov 2023 01:26:06 -0500 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2c6ec78a840so54910941fa.1 for <66940@debbugs.gnu.org>; Sun, 05 Nov 2023 22:25:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699251922; x=1699856722; darn=debbugs.gnu.org; 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=MkDQeyr+QGJ3yJUq4e8CLhwZSTzU9NHlgMAxv/O4+VM=; b=YNwF9oQATUQXB/LY2znmh7uMNSHVflXaJIfhAT96UwD4E54OUNkehSAdfHBJt2/eRd v02AX/VWS/0i519P41Q5cPb6FuLEACI8ZP7cJW2u6RlzKdvwDF9q69mI4DEKm2CprgE8 wHTtnJhvJ5VSX4+cOKgSWb0FYuk4JFDoPMOeUtBqoC5VsQV0d/I4FZe0hAR4JAqikFsk lKBcZ3RMBJY0zm9ES6b+B6tlhGZ6x0boeuby42WNa06lIv+XTRVUjNhI7+/e83rXNaGN ZN6ix1btIyqrmWSXdTtn/IVM2cbm3fYBJAyIurOMZdIYdwkGf1+SqjhGet3qwVqU+n4Q HMBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699251922; x=1699856722; 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=MkDQeyr+QGJ3yJUq4e8CLhwZSTzU9NHlgMAxv/O4+VM=; b=Fy2UkGkdQfEaCYNNO298DjQ4GB6Ri7K76lN6dsHmZGJtlqNLv8ZIZfeykpPSLP8bUQ S1Cj9kfFEJpWt5Kbwk3sZENPd+JUr28vI8DNQXXLLkiHRfhaqZd3F/zdJMG0bi36sjBb 2b5EXWPuZuWZANxLKyL18HLq6QS+iCGW66iJstpjocr6pvXF7Jt/VLvl79CAbW2tVRQF GYuFHyyvTltNjs2HKBVefZ8zq+aCIuzp0/eSLCbAPQxf1m9mYMRojKe/nIpAN3I2EzLf m1+XO5OIrbZhZdRNIQGbdZprwcHiTH85HSWpw0Eljq7KCIxKDHKJuNGMsiyWoeLAXi3O R1Gw== X-Gm-Message-State: AOJu0YzRQGecewwRpnrz/XhNB7TpGCgY7xN1ABFhI6FjdvHDslRJ5OGX bLOu53ov/UXrmEdIs8ctiqyAP81EI3c= X-Google-Smtp-Source: AGHT+IGhcAZFDDXzjsvTk5UoPJ5Qf+aQEnNZFdiTa/SrlQ2NWzxrMDQ73oIcTlQoErGn7ILqjT3ZvA== X-Received: by 2002:a05:6512:1081:b0:507:a5e7:724 with SMTP id j1-20020a056512108100b00507a5e70724mr24821366lfg.38.1699251921435; Sun, 05 Nov 2023 22:25:21 -0800 (PST) Received: from Pro.fritz.box (pd9e36316.dip0.t-ipconnect.de. [217.227.99.22]) by smtp.gmail.com with ESMTPSA id n7-20020adfe347000000b0032fb17c65desm8445989wrj.19.2023.11.05.22.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 22:25:21 -0800 (PST) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Michael Heerdegen Subject: Re: bug#66940: Dynamic scoping is all weird now? In-Reply-To: <87ttpzhcmd.fsf@web.de> (Michael Heerdegen's message of "Mon, 06 Nov 2023 02:52:26 +0100") References: <87ttpzhcmd.fsf@web.de> Date: Mon, 06 Nov 2023 07:25:20 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66940 Cc: Dave Goel , 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Michael Heerdegen writes: > So, I think everything indeed perfectly works as expected here. Thanks for explaining this much better than I could have done it. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 01:58:02 2023 Received: (at 66940) by debbugs.gnu.org; 6 Nov 2023 06:58:02 +0000 Received: from localhost ([127.0.0.1]:38553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qztYf-0006Ge-H8 for submit@debbugs.gnu.org; Mon, 06 Nov 2023 01:58:02 -0500 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]:53549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qztYd-0006GL-FE for 66940@debbugs.gnu.org; Mon, 06 Nov 2023 01:58:00 -0500 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-35931064a3bso16585695ab.3 for <66940@debbugs.gnu.org>; Sun, 05 Nov 2023 22:57:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699253836; x=1699858636; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=L5vWnBULFW29XFxLgTcw7xlp+LT5BiPPt05oxOpBFTw=; b=QY6CARhuu3RUD5ia7iPpPwx20si2GG7JHLvYOXVefHwaQ1cRmhs+u7j+9Oc1lkH41F g/ekdQjlN/mqy/1P2ejDzO/SZnc837tnX7DvcL5otHuvqoeG8Fh/AWcNbd0d18WigQAV 741q3ift1lUwJXStJbPFsjZlHAirOCNlyPJXFjNuESt6Hr163pgotLQ8uzT/MI02gDcW au3poXddw/fQMPqwVGNjUikK50xrVsRU+wlA/ZfLWi8HWe1onyns9O6mKNoqPET5FL+O Xc2mvyCdn9VcfL7DoMPjb1JGmysXYu9S9VmoMn5o3VGPnpYMkh/I8dFCr6uOKKv/lSk1 j1Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699253836; x=1699858636; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L5vWnBULFW29XFxLgTcw7xlp+LT5BiPPt05oxOpBFTw=; b=A6S3hWyr7gKWXzXxfrWQZQ6ZPEpp1f2y3tQbXnt+8xV9OICazocWRhnpwe/cURFxOm fZXLWvfU/L/zjQzx/d/M1FO5mnxAngF+0rFnyWRtHeKaloJsRTltDI6VLTJexZfH414L EPZY+9rSFtmeyRWz/OxShaWvJ+bzJqhAaJOyjrpIoFha8ky0p+Z90qNtVSigaACk2siW QSxcHVOm01rlBhH1f514XDHNzyM+RIWr+mJfkmGrm5b3KWGv4t6z6BoBWdpE/yTwdHZn hYNMe5FSWVVJbIKO33E6yqad+muhMTeiSSNmkqkiIyrddsq5GTXSbv7eQH42NcTb9L4x Oiaw== X-Gm-Message-State: AOJu0YzqAO2UhsVUfzDPKtLHzUy9acRYYmoXI+54NAzcshIneOjL8HfN c0iQxVZ2tbTnXcWIC6M2I6dD4fHRjR69ozcPkJs= X-Google-Smtp-Source: AGHT+IEnW+0qCz20RIRMmSKKTiQbI8rSRlTlSDf7HbHzi/Ec9TAqqYdLs2NQVnuKlYO28N0xxHg4ryb5r2l/4SyvQwc= X-Received: by 2002:a05:6e02:1351:b0:359:3fd2:1dca with SMTP id k17-20020a056e02135100b003593fd21dcamr16242319ilr.7.1699253836428; Sun, 05 Nov 2023 22:57:16 -0800 (PST) MIME-Version: 1.0 References: <87ttpzhcmd.fsf@web.de> In-Reply-To: <87ttpzhcmd.fsf@web.de> From: Dave Goel Date: Mon, 6 Nov 2023 01:57:05 -0500 Message-ID: Subject: Re: bug#66940: Dynamic scoping is all weird now? To: Michael Heerdegen , Dave Goel Content-Type: multipart/alternative; boundary="0000000000004dbcff0609765da7" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 66940 Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= , 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --0000000000004dbcff0609765da7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Michael, Many thanks for that excellent explanation. One more question - With this, first, let's simplify our example as follows. Let's eval this at the start: (setq lexical-binding nil) Eval it, so we are operating in the old world of dynamic scoping. (let ((ii 1)) (defmacro mac () `(print ,ii) ) (mac)) As you said, with lexical-binding nil, the ii =3D 1 had no effect above. It will use the ii from the runtime environment. So, let's try this - (setq ii 3) (let ((ii 4)) (mac)) It evals to 3, not 4. Per our understanding of dynamic scoping, we would have expected it use the innermost ii? Why does it use the global ii? On Sun, Nov 5, 2023 at 8:52=E2=80=AFPM Michael Heerdegen wrote: > Dave Goel writes: > > > (progn > > (setq lexical-binding nil) > > > > (dotimes (ii 10) > > (defmacro mac () > > `(message "%S" ,ii) > > ) > > (let > > ((old_ii ii)) > > (setq ii 33) > > (mac) > > (setq ii old_ii) > > ))) > > This code has two problems: > > (1) Setting `lexical-binding' in the middle of an evaluation does not > work as you think. Either you eval en expression (like the above) using > lexical binding or dynamical binding. If you change `lexical-binding' > in the middle you might get unexpected behavior. Please set the binding > mode only in the file header, not in the code. In the extremely rare > cases where you really must evaluate an expression using the other > binding mode use `eval' with an appropriate second argument. > > (2) Macro expansion does not work as you think. Most of the time macros > are expanded _once_ in the complete expression and then the result is > evaluated. When you redefine a macro in the middle of evaluating code > using it, most of the time this will not have an effect because the > macro had already been expanded in the following code. > > > > You eval this code once. It works. > > You eval this again. It works. > > The third time, though, it lands you in the debugger. The very same > > code. Why the third time? And, why the debugger? ii is well set every > > time it is used. > > It's not surprising. > > The first time you start evaluating the expression using lexical > binding. Because your code sets lexical-binding to nil, the second time > you actually use dynamical binding completely. > > The third run fails because when `mac' is expanded a variable `ii' is > undefined on top-level, so macroexpansion fails. > > The second run is different: because the first run had used > lexical-binding (more or less completely, since you started the > interpreter using lexical-binding mode), the macroexpander of `mac' is > actually a closure that inherited the value of `ii' from the last > iteration of the first run. Because of that the second run succeeds. > > > The second run redefines `mac' so that its reference to `ii' now means > the dynamical global variable, which doesn't exist. > > So, I think everything indeed perfectly works as expected here. > > > Michael. > --0000000000004dbcff0609765da7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Michael,

Many thanks for that exc= ellent explanation.

One more question -

With this, first, le= t's simplify our example as follows.

Let's eval this at the = start:

(setq lexical-binding =C2=A0nil)


Eval it, so we ar= e operating in the old world of dynamic scoping.


(let ((ii 1))=C2=A0 =C2=A0 (defmacro mac ()
=C2=A0 =C2=A0 =C2=A0 `(print ,ii)
= =C2=A0 =C2=A0 =C2=A0 )
=C2=A0 =C2=A0 (mac))

As you said, with lex= ical-binding nil, the ii =3D 1 had no effect above. It will use the ii from= the runtime environment.


So, let's try this -

(set= q ii 3)
(let ((ii 4))
=C2=A0 (mac))

It evals to 3, not 4. Per = our understanding of dynamic scoping, we would have expected it use the inn= ermost ii?=C2=A0 Why does it use the global ii?


On Sun, N= ov 5, 2023 at 8:52=E2=80=AFPM Michael Heerdegen <michael_heerdegen@web.de> wrote:
Dave Goel <deego3@gmail.com> writes:

> (progn
>=C2=A0 =C2=A0(setq lexical-binding nil)
>
>=C2=A0 =C2=A0(dotimes (ii 10)
>=C2=A0 =C2=A0 =C2=A0(defmacro mac ()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0`(message "%S" ,ii)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0)
>=C2=A0 =C2=A0 =C2=A0(let
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((old_ii ii))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq ii 33)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(mac)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq ii old_ii)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0)))

This code has two problems:

(1) Setting `lexical-binding' in the middle of an evaluation does not work as you think.=C2=A0 Either you eval en expression (like the above) usi= ng
lexical binding or dynamical binding.=C2=A0 If you change `lexical-binding&= #39;
in the middle you might get unexpected behavior.=C2=A0 Please set the bindi= ng
mode only in the file header, not in the code.=C2=A0 In the extremely rare<= br> cases where you really must evaluate an expression using the other
binding mode use `eval' with an appropriate second argument.

(2) Macro expansion does not work as you think.=C2=A0 Most of the time macr= os
are expanded _once_ in the complete expression and then the result is
evaluated.=C2=A0 When you redefine a macro in the middle of evaluating code=
using it, most of the time this will not have an effect because the
macro had already been expanded in the following code.


> You eval this code once. It works.
> You eval this again. It works.
> The third time, though, it lands you in the debugger. The very same > code. Why the third time? And, why the debugger?=C2=A0 ii is well set = every
> time it is used.

It's not surprising.

The first time you start evaluating the expression using lexical
binding.=C2=A0 Because your code sets lexical-binding to nil, the second ti= me
you actually use dynamical binding completely.

The third run fails because when `mac' is expanded a variable `ii' = is
undefined on top-level, so macroexpansion fails.

The second run is different: because the first run had used
lexical-binding (more or less completely, since you started the
interpreter using lexical-binding mode), the macroexpander of `mac' is<= br> actually a closure that inherited the value of `ii' from the last
iteration of the first run.=C2=A0 Because of that the second run succeeds.<= br>

The second run redefines `mac' so that its reference to `ii' now me= ans
the dynamical global variable, which doesn't exist.

So, I think everything indeed perfectly works as expected here.


Michael.
--0000000000004dbcff0609765da7-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 11:49:56 2023 Received: (at 66940) by debbugs.gnu.org; 6 Nov 2023 16:49:56 +0000 Received: from localhost ([127.0.0.1]:40482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r02nU-0004ah-Gr for submit@debbugs.gnu.org; Mon, 06 Nov 2023 11:49:56 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:49928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r02nS-0004aZ-Nw for 66940@debbugs.gnu.org; Mon, 06 Nov 2023 11:49:55 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A6FkiMC029365; Mon, 6 Nov 2023 16:49:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=K7sxKRmBicrsoYdFC4tGb3O3s4PFIG8LWHjaCEHKW3I=; b=VTPcgIXOzYdqUfTqglPuRg9X2cwKiUBTUHYTmlPbwDaW3Zio3o1HO0NRzYzDIwLxaNLY S0Gzn/AH5QevVR7WjTSJbSw3fNOR1ipmwRVFhyyicd59wMwUMCAKoxRBNXBXkII+l3Pp Wp8SvtCueF8aUQkX/uSb3+6CFq9XZpH3MYBqj4Zp2/3IeTfYQiQsJVYmWwicT/w4tUwV aTEivEkzszOGqzuXdwCGqRbYftNGluFt0dXDDoJrtcTZYlcJnOlEUz3QR590aAyRZztG T4aYI+XbrYmeE5x8G4zp2FFAYCRL8I76MS+ZZ5fSFhMKMRn00tH837CIT9/yRpXPoK7J bg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u679tjjm2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 06 Nov 2023 16:49:16 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A6GgFYg026972; Mon, 6 Nov 2023 16:49:15 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2041.outbound.protection.outlook.com [104.47.51.41]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u5cd5dwgv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 06 Nov 2023 16:49:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TcA9Q/Czl8FgVQaU8YpoLLsxJtPEQZxv9BK3KVLK8jFrIq7hEgtXu0Z6ocNoeRGa2GlxpWnXrMkj9QtxO+1tCoMlDs4fmIgtaArGPaVBfjT2kcQ0BTp0BvN/Q1DVooa2d/geX8IxPHGX40IqHbSqoYLiYcpktTnxUVVEIEdKiuZBOAAkDvGHZ31u6/7zjwf/nN/VclVQqfEjz4o1vyVc7Zx+oqi850sc7UP1YgnT8CcVpN+WYzbwE1yoohRxknFcmiM53Tmhz2RNv8zJNsTEyxqe8IFBzfNKBJjvc6d7NuB7FGnS28T+SLCMgd9PF2JDw5OV6Lt2d8+EyuT3ubLRCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K7sxKRmBicrsoYdFC4tGb3O3s4PFIG8LWHjaCEHKW3I=; b=aIVVCAsPj7BBlgenX4XJOBaoB9CykLo2vrXqXQEyxLheTYvrF8VZhshok+ilMWFS5eSl0UkQV8prDvfMclrBzNGINsF3+ZzU1+wh/pSMg+Y5yoqBNu2HdjmNOUdDbrS5z64M2TSrW8Jph+zi8Czxj9LpNX3uMzS51jmSYjiZ+ryEg+dlQ0VKQybjszt733Xks5AjbKzrWcdbsQKc30Xhbg1TtQAOgIqiy5juoS73SQIDx15tKoemptcDTUmcdEhofHRRg5x9KcybRrJXPY+AAsvmil5aTMwI5GOpUu5sNxEN8TWmAUOr2IFY4cjZVYT52SU/9vUe1wly2X16Z87b7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K7sxKRmBicrsoYdFC4tGb3O3s4PFIG8LWHjaCEHKW3I=; b=X8Pq+dYxAeXxJ1yCPxs/tKhzXUFRcWz/S15sf+LnejrqNLZ4Be1djnZeZL+2fqe7zHan9SKTOC59/9eh8LIm85FbadF65MQNL5YUIF3XAMjfGrkP0ZtXie3uDcHTsyjTk8rgZgiJrSQymCv+3oD8icq+TW6/9/R572fUIAPqS28= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH7PR10MB7729.namprd10.prod.outlook.com (2603:10b6:510:30d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 16:49:13 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::9e11:9d8c:b7f4:f45b]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::9e11:9d8c:b7f4:f45b%7]) with mapi id 15.20.6954.028; Mon, 6 Nov 2023 16:49:13 +0000 From: Drew Adams To: =?iso-8859-1?Q?Gerd_M=F6llmann?= , Michael Heerdegen Subject: RE: [External] : bug#66940: Dynamic scoping is all weird now? Thread-Topic: [External] : bug#66940: Dynamic scoping is all weird now? Thread-Index: AQHaEHpCDW6pLNKZv0+jJWv5sl4icLBtgTVg Date: Mon, 6 Nov 2023 16:49:13 +0000 Message-ID: References: <87ttpzhcmd.fsf@web.de> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH7PR10MB7729:EE_ x-ms-office365-filtering-correlation-id: 967ad8ee-ee9f-459d-6af0-08dbdee84e4d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5dllnfw5G/IQM5eaVXc1VBg6YZAxHbqmU4yxPIPohJ0TyNWhBfWNwS//umTRz/0MI9pP610ogo5IjyZcNVVynL6S4rr/Sun5ZzVBYNVO+bnlUdecSXSVXwwIEshxMYaFUoSzP/uW6qDktCoogbbX23YORAimjcVlLwlqcmtJhrOY+i3bSZKDHZC5S9P9SofQsK60ih/bHu8TGuWXLeZtgo3nik6xYTdN3MzX/yXWDSGNof+3alc9GbQKDztFvrr8A6WJiMD2oTeIEgZzx1pggTMWvZrt3BVIYGXisRWhOxJqqLSVoHP961l4gqyBA+oIvoO7NV/7H++0nYND2ciK4RXC7vcF8Jyi24iNyn8e6i7b5aw8CNhQkVzmMkqC/wFzMl0TTnG8+f1R+uSMXqO2jVLuUBgXZJc/NQwPSR3J9FLq5cFlEqtCsDY8bVTNzw9SKsTwIg568G0/wWgcdK2bdZzCkteaztTBYMGtXdlkPd+Arn4DoTB+t/Fxw/zEDUlwC6GoL9dFeBTjssAzZRQV24VBpdBNG3hMgWW8VS+GHmvEpu1XrGTjxG30A2G3HkpVDakgXvbupApa9L47EkW/SomEl/0NUVFLIY1fuhchcHRXhNnBxOXlzCl5vzvhqVJS x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(44832011)(9686003)(122000001)(52536014)(76116006)(66946007)(26005)(478600001)(54906003)(64756008)(66446008)(66476007)(66556008)(316002)(110136005)(38070700009)(7696005)(6506007)(71200400001)(8936002)(8676002)(4326008)(2906002)(558084003)(55016003)(38100700002)(33656002)(5660300002)(41300700001)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?LrdF8V9/d1IIoomKwxsEL76+C39MRh30Rvv0ye7DOGrFYH/Bd2sBeZPtOD?= =?iso-8859-1?Q?nEiMMtgfXEuoQ3tS3rNJbHrjRlUnq1QhBIY3UiywVjn9La3yBQXBZ3g5q/?= =?iso-8859-1?Q?rSUfOoHO2SWbyMYeIK3wo/wjLHJxv134Cb78QjmJM3A6mPfsRaV50OcZ6X?= =?iso-8859-1?Q?GS9bZ9YunCQx9fT1Ca1mWx/81YgidOtkvuVjCIIRvLxq2yswD9gTtdyT99?= =?iso-8859-1?Q?K9CXRak7Y71WbQ8fkupvv2mdi6pZbFdLHQLUSG4ycKEKNvAZ7RkbWAEBDX?= =?iso-8859-1?Q?BuQmt0jC/oyI8GpnG5auEVcJs4jHdKOSLmYwYHveKgBdQLWZcDCooxP9r7?= =?iso-8859-1?Q?r60i8ST0Fzug1IBh/MRQSscpSGEb/8bwFxROuMvc/sSGgTLU3k5N5Fj2K8?= =?iso-8859-1?Q?EbubfUmd2s5RaQ7sBHLBdY8NVx51Uhy3OTVcEK9AQKw3ZGAPnN7nqGwjBL?= =?iso-8859-1?Q?yGXdvrvi5/8vlpnuKY1bETgkObYMYWfmN6SR/zgTplpnSnrvwLeAtWc+Cp?= =?iso-8859-1?Q?3nJnSOT3ntzymlJlnPC7zA1JPklzFnXgbDlsnPyNQ7YXHDSBJhzMCRUrE7?= =?iso-8859-1?Q?Qj3mytJimLtcVJSVyYJmEBMz4XUbgWbN6T0upGV1LAZGC3oqs88C9nSQod?= =?iso-8859-1?Q?z6Yf/V8CvkkCav93DJwN+UORMkpjVdwWAmgGGiTrHPHgRDVUwMrhR1H+Uw?= =?iso-8859-1?Q?7xGU0RcveUQIxIuJM6dhZkfWULHgE94Oey/sJuSgkVrHU5vMCbPzfC3kV1?= =?iso-8859-1?Q?BNvgOuf2x6NempP/tvMdukviwBkk5VA5G/KUIeerOESOXX1DrlOYIjk138?= =?iso-8859-1?Q?NvV/dzudFqN6mwj+EpkgvnWmBEwirTFf/xU6DJF0hAR6K919zF5cLuXqhj?= =?iso-8859-1?Q?AuoLX7KLLOCO3bDFQ7temKJDsCvIlSnZyRcqGe7JEtiAMyVtjAiRfiNVfX?= =?iso-8859-1?Q?4RQdlnrRnYBNbkP3S+2rCQ/DPyKpCHIHpy1XW9MNlF/+yeP6LdfRofIc2Z?= =?iso-8859-1?Q?Nck/i4STNpSRSJA7WZxR47Y1FKrnqqHawjXwHmJn8sauUw0wL0jmpAVKXg?= =?iso-8859-1?Q?+cXdITOihT8QwH9WkLNtGTCgdutfYt4T0rYSfDErpB/2rRzIPxWSbVM1D+?= =?iso-8859-1?Q?UaookRc/HYZQ8kXtXHrz/L8CQtk1USqk0vOGEPNO9ad8XuUtZTwBDtyq9E?= =?iso-8859-1?Q?i+uI/4SAy8/mnuBEAaC5RafAUbedYxhoZbtrmAp+UJsnfySiZlIWNkLfrK?= =?iso-8859-1?Q?9T3Cy+CJAeJhg/RsEi9U5vNvKNoWQixdvEFXoEr0ZaeaZBTqbY0IFEW2Bn?= =?iso-8859-1?Q?a+6U9S6CLRMINeSq90tFOk4PE/FLZKyOSOGMmJMbth5yJ4D0x3rO+4PGDW?= =?iso-8859-1?Q?eN6rAFFaMLk2ubNTU127l+jFWR2zy85mJwOq3xgPPP5cVL/4P5ejm9lBVJ?= =?iso-8859-1?Q?cd0vrhYz3QAN3LN2CQpLa1qhEC6jTCTQLnXM9w6KJWzOWd+MBUJ8hws6Vu?= =?iso-8859-1?Q?2o27sPTJjALGhCVNRI4FgZLeRUpw21kTTm+ZXqZfYDf5RDoDoBo7hnH0sz?= =?iso-8859-1?Q?xyLg2FQk/2DYrqPburxzqHkVc9L2dJI7yOHJWXrz06eCSQs3FXbeBtu5+F?= =?iso-8859-1?Q?3Hit/An1Gypch3LeIlAfXKH/kuArEoODor?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: bY9/cmo79Xt1zr+p7LJuZ9DTZ5JUEOqFcbJokYAetQDiGd9H5thW1peOzDZRlrF83xYXtgxHuBh2NUgukm+ntL4cOzHWBEiaQk4Iut9/h6DS1k3eQfKtisofpVbxazKUha1LOx2iVpUhECGXTMPSIR5OSW4f2lDNUIQDshAESBU5y88tGMKwqfpxFmoV6NHhtZXn/UFsze3UhYT4CVFucwsvglwZ0VklDdeUul2oJaTCTQMAq4nXDVQCZIU0d0K7bv4NcPt3szH4bIP6K3uLFoTNNrvGxCSZo3T+EdYhs4RZiGoHt9//XrAIXgQ0bWB56Gy+fsYytXx4sLTyaXqSMIsLpMWX6LgjxgkNdsl4zAycqRl9hPEP6osWLIE5+7gctg4DCY9YWi3r24+m5r5f/Xlu/CizjiJwUN940aeOtitIQSl75B7ybRGiFehknCFQVWD+LTMyhQ3iZ4hdUfr1wYehmYXKCb6COihm7feuQPvA10OaOrZq4Y0jNeCG/ES9bDfcezPqlhrTVMYW7/klbqEM55e8FxifoQAVsBmOfsj3bbk0MxYNkQi2OvaCc/xAsjOMzdAShLwsHym1qyiKZFWfe410eP0WPqlEEUBdU4o700VqTuTfbi1h7sqK8a0ggwAuX6OF8Uj+0d8UDh1pbBSAKEYhssuORlI/XxBQoFoZC67gWeNVv9h7xhWUTloomh5GD73GYLPt9C66I9CAY9sTj1ykOLqHEw12HH4eHf8KUCIxhvdr/mKCubn/kTzs1hkudOxkQANvWGq1NAxACP5LPwl30R0PqF0DZqBTfjwwkH8BfOyFpvBN81y2LTIQ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 967ad8ee-ee9f-459d-6af0-08dbdee84e4d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2023 16:49:13.0517 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: T9s3vsirM2ATHGJvlcu5JyZC45mAqZcWwh8xJ2CS224B/3M/fsJGnMeT7mQQegIhCMYC3GATqlRNiriLWiixJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7729 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-06_12,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=705 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311060136 X-Proofpoint-ORIG-GUID: y2nFdTJC9kkJ11-hSUMEsiof6Z-BwpfY X-Proofpoint-GUID: y2nFdTJC9kkJ11-hSUMEsiof6Z-BwpfY X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66940 Cc: Dave Goel , "66940@debbugs.gnu.org" <66940@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > > So, I think everything indeed perfectly works as expected here. >=20 > Thanks for explaining this much better than I could have done it. Ditto. And for helping me _understand_ it. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 07 00:44:40 2023 Received: (at control) by debbugs.gnu.org; 7 Nov 2023 05:44:40 +0000 Received: from localhost ([127.0.0.1]:41155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0EtE-0002r8-Hx for submit@debbugs.gnu.org; Tue, 07 Nov 2023 00:44:40 -0500 Received: from mout.web.de ([217.72.192.78]:53831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0EtB-0002qr-KG for control@debbugs.gnu.org; Tue, 07 Nov 2023 00:44:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1699335833; x=1699940633; i=michael_heerdegen@web.de; bh=DoQGpJI7NAe17aimv2I9quPe6sVf5RhdRzIZFGRWxI0=; h=X-UI-Sender-Class:Date:To:From:Subject; b=fvEX4vBV9XqqWtNqMtgN2TmZj6DwGslvlOPqSVbPkQzhlFNkUd//tDVBkS6H+RyU Q3XcobNiGvJJEC6FcpG5gkwreD3eyLSo59kdWI7Btcz0X38NDmVnq6R7dWwZPomca uaN//pURqdUSc3UVKfo/mo81K/tmDiXbb2WmHtSsRNrG+/iLzodXSmvztL1tlwNmL XYWWADd19jZGpqP3O3X9f+HcBiA14+aL1HewA6e0X/PrN8HoRFzR47JbnjXf0ma1T xUk93dVXZ00Fl38IKMdVjbZqOyqLoYHEDwj0UkWQJZRENRAoRnzjsKsnJlQqdhkX2 2AYRTOA0M2URCw8tHA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.59.210.159]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MQxo5-1qoMG73ouN-00OBk4 for ; Tue, 07 Nov 2023 06:43:52 +0100 Date: Tue, 07 Nov 2023 06:44:03 +0100 Message-Id: <87msvq3yos.fsf@web.de> To: control@debbugs.gnu.org From: Michael Heerdegen Subject: control message for bug #66940 X-Provags-ID: V03:K1:hxIBUsx6j0iBtzHc5B3YaMfvJXyuKN1PEe6zSUGa8SRYaIx6iIJ g7+wcntF7fm+dBftI4oE/qvGsG5JEBNDvahLw6f/UUVo0HJ4ZnqYX6Z0i+a90i+yt/ttsYx U1vgSWJG3fbY+qbUvTrcpfpHLGidHkwLXodfgJLyLrXwgcev/yQpUuwA+d7/ks3KJNxy+vc GMgTTOWgCFlfLLfDOxTjQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:45yZKY+beO0=;5YlH8ggjz0SzZShy4k6PaRraMoW cSxL8QJ4rDCqUtcmghLz9Ph3ib/JZQtwa09W10LrSMDUDRU6VC1y09L08CJ/NVdfsRXCR3N+C PKIR0h91W5HAy0wI+fQGcbQB6acsIDv3eVgZJwhpa2J2MNfrtWOiZ0YffZkIf06SYcKSCDzlp MMxLFGhjBhxpSvY+ricTU+JaaQhF+Tnqe9rkU1Yc/BXn8jB2WfxFxetRK+06cnizSBLm9zhlr uX6JFvbjhaTEMQXqVtWsN4ZDIOnDLKqFuHjyR/FbDG/G8wqicCm+xvl3BkXi6g8aAJDWb96ju 2BMWGLTjJJP7yYA/pAcyx8nK4CcJSC4WZwxDXRbyqlBEz5ZhAkvWk/6EugvhP4XttIVCh5gQT A4J2tS6ugle/f2AVusM6kcn4hv4iEzS7JpxkPL8Y7NhxZqnStfyxv0o5toR0r8V58Ek+biptH V7nHxB8pRuHJRsXzQN5It7ohBcbpMVAWTqc6AI7mvklcjqCeDFgbQVSdRwII0khRSQ8sgCAIx 4TXJMlUj6tG6NvU2RYTJWKAK8TT9e34WOrs2rq0WPM8Rq1YI/lNLBeKwD01s3egzwLphwlcaF Q1dO0YTEhPcetAil5RY+Pnw/BIivsllKj79/nSGceUK82kCjZ0bbJnZtZ67CNijTnsEsfvh5p 45FgphR1pxf2BznnK5Rrk8YKljwhINz71amSpMQqjZr3UkY977pVSvCb0LPi091RrhmnEFdNq O4I5FSKfivSoo7SzOzhSHO8JXsmUycF4bUk1otDKMSK16ozI6jd4GJR6f7K3FXid6fQCAo6e3 k/IHeYjzJyKXtpdYKl7vw2iHsGvpqVY+ijZgeecBqhPUKmYsUw8eZXZAoz6rQ/V2Aw77X9urA f8kYVFGxGTd0s+oxH40JfmrXTemekT6d3HdbUVra2WT16IbOUKeFjrnVPMcdrvKhX7ZNAzyWe lDvOdkeGPIOBe4MjIiFzVoCQ2UA= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 66940 + notabug quit From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 07 01:00:21 2023 Received: (at 66940) by debbugs.gnu.org; 7 Nov 2023 06:00:21 +0000 Received: from localhost ([127.0.0.1]:41160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0F8P-0004UN-06 for submit@debbugs.gnu.org; Tue, 07 Nov 2023 01:00:21 -0500 Received: from mout.web.de ([212.227.15.4]:53599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0F8M-000425-Cr for 66940@debbugs.gnu.org; Tue, 07 Nov 2023 01:00:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1699336773; x=1699941573; i=michael_heerdegen@web.de; bh=g2+PkVPfmcna6CcJRmZMi/7JQT+ZzgNO2AcvtMnAToM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=QTW/l3Eb3h0sMt5QqnABCBh5r31DO8/xTs69KDfodq57+9magNu0HaoWtcFavM3h irpWxgx/U8YpT6qtLV/tY3ATUPCbU3Ca7veHeVgaad11a8ooG1xhazRtqzWWn6p2X urWzBI6l1koiUSJvjILpbLptrs920yDT59CZSbF+LbxENXWdU7dWt/IcZXvBTSZ53 +v0U3C0zjBmTAH1IH1WkRFx/KRKAdefIUHlywrl/1zFPW47J/t33xDt5D3mixiOfn NQjjS89X5kG/M92DiFKHOhLoBobLYwUei6l6+D30dHFYh9VHnbhdQFB2ndd0m0g2i +sDotMdHQHZjy/V1UQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.59.210.159]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M59n6-1r1LaD2alY-0018Dd; Tue, 07 Nov 2023 06:59:33 +0100 From: Michael Heerdegen To: Dave Goel Subject: Re: bug#66940: Dynamic scoping is all weird now? In-Reply-To: (Dave Goel's message of "Mon, 6 Nov 2023 01:57:05 -0500") References: <87ttpzhcmd.fsf@web.de> Date: Tue, 07 Nov 2023 06:59:44 +0100 Message-ID: <87il6e3xyn.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:NZRbU2v22i3J4JtB1EFkllI0z1OnS5A2iplndT5W/oug2+ZdbHc Z62JS/BksSaZuBOI1M4chSOdU+mIN9qjLjMvBu5BUdbjdlH7pMiAOLtZDVShp/VsCoIgOAb xCubsyIsVrd6CF8YtKxr3LNRhD86VEeValHdAQY3Bh1v0FvLK4qRLJXYZ8dTdEvOxwR06No 5zrAe400/96TfCkuj082w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:nJsORGzmc84=;Lcngtkd5JQdEhPYImMjE9wh2Rdv YKjvL7YGrFPM0KqAqftKFHUnrOe5BeEl78hZkC0s+YHmlB6s7x6GMRE3p4i52EnwyuHEiQkBb rZgLm6jMwGx7MxI6Wh8eULfWlVrp+8XGMPEwl+vZY/wVAW5lzCxboy0JTLoX1NfYAiFKgafeC /x5o+WiH7a4+7POiodPUhJlDgyPyQ8Dtam7pzmfBBUOI0w9e0q7WZUp94me6qWzzjdIJM+znV Iks2RaBsNZBAyMCTYObK6fC+/MMSyylvSi6aZqe73dARMK7X03oj5q8L1s7CnZZpvtKfRSrG7 w2Hi+QagCIvotcpHfqrwwR5LIveTs4kbOjSLbk1fKW0tXsz0B1LUIEWRtdBHw2udC3aQhe8ZB paBljbTfhSLNII7+lWqTRImuUffL7sFOLoBpR5UGKycdQgMLvp8Buc0zvy3kLBFsIo2jCDyDD pJQutWa7+MJyK80w/c0j13YLyIyHlaq2YIOUgLjwyZT0goVB6t6KTAqUeUp0EqtaPtCNy2gkZ Y7s0Q7fAZ9VSgTANRblKp35HjbkAQHLFQm4pP9HIpwVZ9gh/U/OWt0bcDCze8+t6RRP4qksVw 1Cq3QfKmKfF9lUVNfwmSA87JHXUbEa09S7kthJeFUVXJ0n3Iu0P23mkWbzhc781jHsFv0J+6A F9F/8B3tOi993g5q3nHXHTXf0Te69XluuPM+l9zMCSRf9J1dSTz79MfYwbg3w0sgg45IwysY1 1jWHKC+nf9Mvc8mNpuah7Q8ichOA1qjx5uibACTv+L3evnEvJMneHtyP0UJZeZV7W667RZWyw XsNwSCHs4pF+Z9QP0GWjhmiUtii9HsVr0zpGSpo/WFK7x/VdfFy6z9YxsCYhkv4aqSC2Zefpg tiSh2D++5H+wxT6JHrNEFu0F17Mh/7HNrn38Pls0+hVah5MP/NF5hnV3cszhMBjOzYmk70a/z 7G4YkJCYJoXW8BaqoX8wsAjC+3I= Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66940 Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= , 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Dave Goel writes: > Let's eval this at the start: > > (setq lexical-binding nil) > > Eval it, so we are operating in the old world of dynamic scoping. Ok, let's do this. > (let ((ii 1)) > (defmacro mac () > `(print ,ii) > ) > (mac)) So now: (symbol-function 'mac) =3D=3D> (macro . (lambda () (list 'print ii))) > [...] > So, let's try this - > > (setq ii 3) > (let ((ii 4)) > (mac)) > > It evals to 3, not 4. Per our understanding of dynamic scoping, we > would have expected it use the innermost ii? Why does it use the > global ii? Remember that macros are not expanded on the fly - they are expanded once for the complete expression in a separate step _before_ the actual evaluation. So: (setq ii 3) ; ii --> 3 Expansion of the second expression: (let ((ii 4)) (mac)) ~~> (let ((ii 4)) (print 3)) ^^^^^^^^^ expansion of (mac) Evaluation: (let ((ii 4)) (print 3)) ; prints "3" A different thing would be to define (defmacro mac () '(print ii)) Then the expansion would still reference the variable. But you could as well just write (print ii) then. To sum up: you are using macros wrong in this case. Macros are not expanded at run-time. It is important to remember that. Note that not even `cl-macrolet' works like this: the definition and scope of the defined macros is local, but they are still expanded before evaluation, so the expansion can't refer to run-time bindings as well. Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 07 21:50:18 2023 Received: (at 66940) by debbugs.gnu.org; 8 Nov 2023 02:50:18 +0000 Received: from localhost ([127.0.0.1]:43806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Ye1-0000X0-RS for submit@debbugs.gnu.org; Tue, 07 Nov 2023 21:50:18 -0500 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:57807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Ye0-0000Wl-9s for 66940@debbugs.gnu.org; Tue, 07 Nov 2023 21:50:16 -0500 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-35961c61ffaso17747765ab.3 for <66940@debbugs.gnu.org>; Tue, 07 Nov 2023 18:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699411772; x=1700016572; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RZIob20/4igOkC7bgPcVgY10NfOLpdDcriRJ3e7LFuA=; b=J6wOVvN8GPE2h5iT7NoeSs79L0KDerUPWLnJl5DoATXcHVWBT4klgjJvlWQ6spk8zH 8i8jD3sNke6cdEr9ZndXu1lxZRTbVfj7rm4TAhU+1VWAtR5/1/sma6WOLqodMiXDxokz 9JJogMrUB4EgA5BJT2qiOx0cZaN1cFym/YLIY7BCsil2+ZRW6zHz9bVQW1N2jbquOsM0 JPN6ph0rUj3HGulMvsKMyf6RWovrau0dK66jitSNHRiYAwrJC2eIV7m6NdZb+TOpt0Bq 6BGcyXUqy0fTyBrSnuWt8UqJAlxNln4X/ado7zyouaXkwveTjA/iNVvw1RZJGjKQXKVw +85g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699411772; x=1700016572; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RZIob20/4igOkC7bgPcVgY10NfOLpdDcriRJ3e7LFuA=; b=RHl9OF+xsor56LlCeV//gFrCgWra36zDstl5eYyabBLTD0kbBVT4YszQfmHbxg2vtC 6k/C+Q4TuNSuIHCa9HkHSw2jm02Wq2yGZ3PCgi4tZWbMwitCOQuHxUFlZLqCoDbCokck jUqhWUSUrQIR9w6110mtpPU0AHnU/h2tHSMOr7RnqDtXCMNoIJAG+dQLBjJtqGOUsTF7 nTb6t7JAIXGfiZgwaT01q6Y7wCwFhQdrpLArC2Q4e/UO5wUdn9299Y2jFHTfzkcn+6/R HNl1TSg6Wy32Ng5jD/CMn2uVMR/1noM0c1iutCINwyIw9pZbAWpK0z3EBeO0tgwIsXXw BAxw== X-Gm-Message-State: AOJu0YySBFzRjKg8XBxsro/RoeqtViY1nHccS0Rs105i2id+Ey2RriKC CJmfBMf58wTYaBcEfebp8CL01Sq2cLwIxhR+qQ8= X-Google-Smtp-Source: AGHT+IFegUcNcXujBaxD9oDC1G7tppEZG5KREp0HSeLHIc+MDIwz2FC7dHDeCc26ZYebh0KV4RygelZpfCuoP56tNcs= X-Received: by 2002:a05:6e02:1549:b0:359:8072:3dea with SMTP id j9-20020a056e02154900b0035980723deamr968665ilu.11.1699411771899; Tue, 07 Nov 2023 18:49:31 -0800 (PST) MIME-Version: 1.0 References: <87ttpzhcmd.fsf@web.de> <87il6e3xyn.fsf@web.de> In-Reply-To: <87il6e3xyn.fsf@web.de> From: Dave Goel Date: Tue, 7 Nov 2023 21:49:20 -0500 Message-ID: Subject: Re: bug#66940: Dynamic scoping is all weird now? To: Michael Heerdegen Content-Type: multipart/alternative; boundary="000000000000fdc64006099b22cb" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 66940 Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= , 66940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --000000000000fdc64006099b22cb Content-Type: text/plain; charset="UTF-8" Thank you --000000000000fdc64006099b22cb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you<= /div>

--000000000000fdc64006099b22cb-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 07 22:08:48 2023 Received: (at 66940-done) by debbugs.gnu.org; 8 Nov 2023 03:08:48 +0000 Received: from localhost ([127.0.0.1]:43820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Yvv-000114-Se for submit@debbugs.gnu.org; Tue, 07 Nov 2023 22:08:48 -0500 Received: from mout.web.de ([212.227.17.11]:49147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Yvs-00010k-Pn for 66940-done@debbugs.gnu.org; Tue, 07 Nov 2023 22:08:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1699412879; x=1700017679; i=michael_heerdegen@web.de; bh=iNknBzeuerDU0rS+KN9wwt8FJG9lFK8xShXHawWRr7g=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=IJt2sYCXtw6zrHIqh+fDFWnZ1S8SJGW8XkAGyJVVdkYmvV4VksCVxo+aRUb20Nxk /h7U3A6B/rCZQtkwud6z1Hz/pyWQL+cJHQXggT8fycwU+HdhzmDq/VX4en9iRe079 fUt6ib6icMMYOz9M9zH9O3ER3uCq6WP/V2iIQIKtHf/6hrQUkouqPVDnRuCKyoIA0 zmjy7lNDDFLt+RnTSuJ9Iig47rNd2Mw640Ddk89ZqMRZMcVSrE2UgzcNCSeCMuwbm 9+1NJEh11PIaZj17gGr+LWEU71yBQ3qNLnkxbzymjLWhTjjEt3F2T++v/IobjCKsv 3ljSggZ2pnXV1dO7og== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.59.210.159]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MREzO-1qoNj90E0S-00NAi9; Wed, 08 Nov 2023 04:07:59 +0100 From: Michael Heerdegen To: Dave Goel Subject: Re: bug#66940: Dynamic scoping is all weird now? In-Reply-To: (Dave Goel's message of "Tue, 7 Nov 2023 21:49:20 -0500") References: <87ttpzhcmd.fsf@web.de> <87il6e3xyn.fsf@web.de> Date: Wed, 08 Nov 2023 04:08:10 +0100 Message-ID: <87fs1h7xid.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:kyssLscs5Wjf4OBXLgB88sVnoZ6uBBxdDig4unK+dqWEbQ2M8Ee k70iVrsvXQzfZOuyRDLo6/HJ+bDmBLgZerOxbkZ0K04zFKGpeXtK9A9tUv4JeKwtK0kjnB0 yzMfg9e688Qw6dbBUoH0epFIOIutAludZab0Jwhvd6KksE8+sxhzzy6yWHyWuDYF+ZvF668 h9olCFXObahLBgEwumuHg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:/EX76/3rXTo=;jBxkG6+daqUbQ3mhktpdySX1ge3 1y42Mzv8uK0Yr0OVjQ6U+3NX+hci6jT5zckAxWkglybDUvif05l4O7q8xr/ax+D82JHXOESy4 CPq2f0hjHRMVplpzfaZ6cs9NbP2Cs9133U9Xy7woxZXeftgUEpAN0cywqu1Xytqv5XZuywtEi 2Z/YUsZ3kX0t2Rkm3HlY++dI3656HjMyrDtwlPGll6DUyC5owPwZmUPEUFjOUAX96jJ8iWo7O JRqDqWNnA5/mYUAlHKzxShIgbH0a2JDKAjW25bMTI4QQf+Otw4345dqaJxo+gsaovMbe2iJM0 xkYOxYHGguTNrCjGY0lwtBx8aXxKIpwoy7Ffd3q0vM1w2imM5pQ/zfiHW7TqSGfAQxdZ2qPEO VwDEvY8RgqXfwLcQgJF3Yz6/ELx30Dy4AN6pH4fwyrKwqnhydZIUjKPgMI+s5qiOvzTJWbq2H wqdkNa65j2xCoJ+e8zaXpYQVyzgjtQ74e3Q6vH/KCHfDs1WmKupaoXPjXiYfMaEMKeVoG0ZX9 Kx30YqJ8N9YmjZnt49rhqqCvddpMxyvHz43G+WsIexfxFgC1NaYm7e+EC+HEP3m4G95SrZsfc zavoXC5hXuyk9N/dMPXNv0k+43N2dee15G80PvzW2jypH+gTMu+8cGdRZ1lNW2PPPJecdqA6h c6Ue2kNl5pxkSibw1F3dVuyJMyo8s2lYpbfYkioysYcDmUYnWR3G35WcNZQmsYgR8IGi5LtWj xV1RlBFLlYJq1ZBUukCePBS9dRY911XUnajzHqazg0AuJztIK0ph1kE8rQhCjIJ/jKNmpS15l N0EcmclzlzYLSBfttXMmwFqY4XY+uS5QMBbzUD+Ea5/EIKDMJTFpDmMA1uVI+OLoBb4XD8fHo HjdMKE5LfK/DpF4mhgcsFAhC2gqMmPsG9cradDHbQIOV9OLpk86bOaguwv1fjAvWTEPSicG5g stRmxQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66940-done Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= , 66940-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dave Goel writes: > Thank you Then let's close this one. What I still wanted to say (to you): no need to complicate things using macros here in your example. Use functions, then variable references are simple and clear. If a macro (expansion) needs to refer to run-time values, use macro arguments to pass an appropriate expression (like a variable). But this is overkill in your case, no macros needed. The purpose of Lisp macros is to extend the language and/or rewrite code (at compile time). More or less, only that. Always think twice if you really need macros, try to avoid using macros when possible. This will make the code easier to understand and maintain. Only if a macro introduces an abstraction that makes the code actually easier to understand justifies using one. Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 07 22:22:24 2023 Received: (at 66940-done) by debbugs.gnu.org; 8 Nov 2023 03:22:24 +0000 Received: from localhost ([127.0.0.1]:43833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Z95-0001QG-My for submit@debbugs.gnu.org; Tue, 07 Nov 2023 22:22:24 -0500 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]:44389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Z93-0001Pw-9F for 66940-done@debbugs.gnu.org; Tue, 07 Nov 2023 22:22:21 -0500 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3594149e3a1so21867125ab.1 for <66940-done@debbugs.gnu.org>; Tue, 07 Nov 2023 19:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699413697; x=1700018497; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ikGKn26WVRRTjbTwMMeHwm9W/2uArLGQMph4kZRUOfQ=; b=ILxfttCrn6htRMSOMp4S73U3aWSTZBA2KPrdf8YrIt7ZaYZMcFBLkztxhFhE0LeuEl 6zuT82edaoTYvL1oWJIj8EHjukxoiW9zVedp218czfsvkGbw/sNqaJMx1Zouyyabigfo 3RV4NcmSE2Hx0u8ML+315+ntNr5P2IMuYbT+WnobH8dqUCVltDMRDunRyVHB5vMHgrzC 2SogjFZz6FHRMbxW+JWVJvSAkUEN1edSMO0+wt55sN4lE2SnMrPeGzj00QAzeoQ/EF+H hOOSllkZX2sMWveOp1uIFGpFkmeyL9sDTnLW65SHM/VwS43DUInH3oizAu7Ti9UkpDIf OaTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699413697; x=1700018497; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ikGKn26WVRRTjbTwMMeHwm9W/2uArLGQMph4kZRUOfQ=; b=h7JczFX7Y67Wh49Ry9Ge39Qn+K3kc/tc/FBvZtSSDOAOX0oaFKGvH7Ha+WU6F7WI8Z 9+6aGtvg23CU4WUmN4CJyRd+CgR05V8RmRXUvksOWSYy6glPdv1eHpjQU92ddzO9yCAC v1U6o/2Idg3m4LQhQn67zvNHtfTCl0PIa5O9MlbqwchK1TL2nbcL3nyLACmuYZ9LKYgJ SJaM0uewn8hQp06lk5M5nQ+P886tOJC/2gQnUvbxAt9YbuQXkkTRXDEHtJ8L7Var/WgR f8giEN2NJJdIPzvq3hP9Giw4PatcGEAkJ0YY+YM/hujzcnm3uNejTrGi3p2wcyl5QI/7 VJ3A== X-Gm-Message-State: AOJu0Yz6rt9EL/ktxUQjxlXbXByi4DZrkWAIm7Z3ttloR2XB82wFBW8R Et9AcxxK8spVVHzmDoa9YE2nOwFWUlKhSngKmydRrqkhwPM= X-Google-Smtp-Source: AGHT+IH4sKM8ykPLVK4oai69yZj/PFLQ9II9ueWjmcOSzj74/fzsBp0DIKn3Uv0cw6MPVEHPBtj9hsudziOQXYhRZ38= X-Received: by 2002:a05:6e02:20c3:b0:357:a640:3235 with SMTP id 3-20020a056e0220c300b00357a6403235mr1046955ilq.29.1699413697230; Tue, 07 Nov 2023 19:21:37 -0800 (PST) MIME-Version: 1.0 References: <87ttpzhcmd.fsf@web.de> <87il6e3xyn.fsf@web.de> <87fs1h7xid.fsf@web.de> In-Reply-To: <87fs1h7xid.fsf@web.de> From: Dave Goel Date: Tue, 7 Nov 2023 22:21:25 -0500 Message-ID: Subject: Re: bug#66940: Dynamic scoping is all weird now? To: Michael Heerdegen Content-Type: multipart/alternative; boundary="000000000000bffbfb06099b951e" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 66940-done Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= , 66940-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --000000000000bffbfb06099b951e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Most absolutely, and of course. I was just trying macros here to improve my understanding. Which it happened, thanks to all y'all's excellent explanations. On Tue, Nov 7, 2023 at 10:07=E2=80=AFPM Michael Heerdegen wrote: > Dave Goel writes: > > > Thank you > > Then let's close this one. > > What I still wanted to say (to you): no need to complicate things using > macros here in your example. Use functions, then variable references > are simple and clear. > > If a macro (expansion) needs to refer to run-time values, use macro > arguments to pass an appropriate expression (like a variable). > > But this is overkill in your case, no macros needed. The purpose of > Lisp macros is to extend the language and/or rewrite code (at compile > time). More or less, only that. Always think twice if you really need > macros, try to avoid using macros when possible. This will make the > code easier to understand and maintain. Only if a macro introduces an > abstraction that makes the code actually easier to understand justifies > using one. > > Michael. > --000000000000bffbfb06099b951e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Most absolutely, and of course.=C2=A0
<= div class=3D"gmail_default" style=3D"font-family:trebuchet ms,sans-serif;co= lor:#0000ff">I was just trying macros here to improve my understanding.
=
Which it happened, thanks to all y'all's excell= ent explanations.


On Tue, Nov 7, 2023 at 10:07= =E2=80=AFPM Michael Heerdegen <michael_heerdegen@web.de> wrote:
Dave Goel <deego3@gmail.com> writes:

> Thank you

Then let's close this one.

What I still wanted to say (to you): no need to complicate things using
macros here in your example.=C2=A0 Use functions, then variable references<= br> are simple and clear.

If a macro (expansion) needs to refer to run-time values, use macro
arguments to pass an appropriate expression (like a variable).

But this is overkill in your case, no macros needed.=C2=A0 The purpose of Lisp macros is to extend the language and/or rewrite code (at compile
time).=C2=A0 More or less, only that.=C2=A0 Always think twice if you reall= y need
macros, try to avoid using macros when possible.=C2=A0 This will make the code easier to understand and maintain.=C2=A0 Only if a macro introduces an=
abstraction that makes the code actually easier to understand justifies
using one.

Michael.
--000000000000bffbfb06099b951e-- From unknown Sun Jun 22 07:59:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 06 Dec 2023 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator