From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dave Goel Newsgroups: gmane.emacs.bugs Subject: bug#66940: Dynamic scoping is all weird now? Date: Tue, 7 Nov 2023 22:21:25 -0500 Message-ID: References: <87ttpzhcmd.fsf@web.de> <87il6e3xyn.fsf@web.de> <87fs1h7xid.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bffbfb06099b951e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18064"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , 66940-done@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 08 04:22:41 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0Z9M-0004VS-QN for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Nov 2023 04:22:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0Z98-0005a4-Dy; Tue, 07 Nov 2023 22:22:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0Z96-0005Zh-AV for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 22:22:24 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0Z96-0005uQ-27 for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 22:22:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0Z9i-0001RT-9X for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 22:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dave Goel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Nov 2023 03:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66940 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 66940-done@debbugs.gnu.org id=D66940.16994137445477 (code D ref 66940); Wed, 08 Nov 2023 03:23:02 +0000 Original-Received: (at 66940-done) by debbugs.gnu.org; 8 Nov 2023 03:22:24 +0000 Original-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 Original-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 Original-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) In-Reply-To: <87fs1h7xid.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273964 Archived-At: --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--